etd_model 1.1.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 39118c45c70f4c421385dad49669e169db16e0d3
4
+ data.tar.gz: 3e791f60b2d0be686b8f91448d04430387cabd9c
5
+ SHA512:
6
+ metadata.gz: 1fde7d8dbc07018578dfa740888d4971c6d1eeaa071c0ec6f30e2ecfb95ae6896dbc2932b8ade1dabe511a956da4ab1a50d347c1aa5bf52e1234b4a052866301
7
+ data.tar.gz: 748318dc8c1ad78ce4421ce3c274315eab9bfdbd245ecc74a2d22b355f9963f91732ce8bd7661a728300fdd7f8e631d3820354e50e69afeb62a6b955ec6b658a
data/README.md ADDED
@@ -0,0 +1,22 @@
1
+ [![Build Status](https://travis-ci.org/sul-dlss/etd_model.png?branch=master)](https://travis-ci.org/sul-dlss/etd_model) [![Coverage Status](https://coveralls.io/repos/sul-dlss/etd_model/badge.png)](https://coveralls.io/r/sul-dlss/etd_model) [![Dependency Status](https://gemnasium.com/sul-dlss/etd_model.svg)](https://gemnasium.com/sul-dlss/etd_model)
2
+
3
+ # etd_model
4
+
5
+ This gem provides the `ActiveFedora::MetadataDatastream` declarations for `Etd` and its corresponding `Part` object, enabling the hydra_etd webapp
6
+ and the `etd-robots` to share code. The projects should derive their own local versions of `Etd`.
7
+
8
+ Common methods should be added to the `EtdModel::EtdHelper`.
9
+
10
+ ## Releases
11
+ - `2.0.0` Updated base of dependencies
12
+ - `1.1.0` Added embargoMetadata and events datastreams to the Etd model
13
+ - `1.0.0` Gem built without Jeweler. Using bundler and rvm.
14
+ - `0.0.3.1` Handle term element with Active Fedora 1.2.6
15
+ - `0.0.3` Updated to use Active Fedora 1.2.6
16
+ - `0.0.2.1` Handle term element. Last version compatible with active_fedora 1.1.13
17
+ - `0.0.2` Moved #get_embargo_date method from the hydra_etd app to the EtdModel::EtdHelper module
18
+ - `0.0.1` Initial release
19
+
20
+ ## Copyright
21
+
22
+ Copyright (c) 2011 Stanford University Library. See LICENSE for details.
data/lib/etd_model/etd.rb CHANGED
@@ -1,80 +1,72 @@
1
- require 'active_fedora'
2
- require 'datastreams/embargo_metadata_ds'
3
- require 'datastreams/events_ds'
4
-
5
1
  module EtdModel
6
-
7
2
  class Etd < ActiveFedora::Base
8
3
  include EtdHelper
4
+ include Dor::Embargoable
5
+ include Dor::Eventable
6
+
7
+ has_many 'parts', :property => :is_part_of, :inbound => true
8
+ has_many 'supplemental_files', :property => :is_constituent_of, :inbound => true
9
+ has_many 'permission_files', :property => :is_dependent_of, :inbound => true
9
10
 
10
- has_relationship "parts", :is_part_of, :inbound => true
11
- has_relationship "supplemental_files", :is_constituent_of, :inbound => true
12
- has_relationship "permission_files", :is_dependent_of, :inbound => true
11
+ has_metadata :name => 'properties', :type => ActiveFedora::SimpleDatastream do |m|
12
+ m.field 'name', :string # PS:name
13
+ m.field 'prefix', :string # PS:prefix
14
+ m.field 'suffix', :string # PS:suffix
15
+ m.field 'major', :string # PS:plan
16
+ m.field 'degree', :string # PS:degree
17
+ m.field 'advisor', :string # one of the readers?
18
+ m.field 'etd_type', :string # PS:type
19
+ m.field 'title', :string # PS:title
20
+ m.field 'abstract', :text
21
+ m.field 'containscopyright', :string
22
+ m.field 'copyrightclearance', :string
23
+ m.field 'sulicense', :string
24
+ m.field 'cclicense', :string
25
+ m.field 'cclicensetype', :string
26
+ m.field 'embargo', :string
27
+ m.field 'external_visibility', :string
13
28
 
14
- has_metadata :name => "properties", :type => ActiveFedora::MetadataDatastream do |m|
15
- m.field "name", :string # PS:name
16
- m.field "prefix", :string # PS:prefix
17
- m.field "suffix", :string # PS:suffix
18
- m.field "major", :string # PS:plan
19
- m.field "degree", :string # PS:degree
20
- m.field "advisor", :string # one of the readers?
21
- m.field "etd_type", :string # PS:type
22
- m.field "title", :string # PS:title
23
- m.field "abstract", :text
24
- m.field "containscopyright", :string
25
- m.field "copyrightclearance", :string
26
- m.field "sulicense", :string
27
- m.field "cclicense", :string
28
- m.field "cclicensetype", :string
29
- m.field "embargo", :string
30
- m.field "external_visibility", :string
31
-
32
- m.field "term", :string
33
- m.field "sub", :string
29
+ m.field 'term', :string
30
+ m.field 'sub', :string
34
31
 
35
- m.field "univid", :string # PS:univid
36
- m.field "sunetid", :string # PS:sunetid
37
- m.field "ps_career", :string # PS:career
38
- m.field "ps_program", :string # PS:program
39
- m.field "ps_plan", :string # PS:plan
40
- m.field "ps_subplan", :string # PS:subplan
41
- m.field "dissertation_id", :string # PS:dissertationid
42
- m.field "provost", :string # PS:vpname
32
+ m.field 'univid', :string # PS:univid
33
+ m.field 'sunetid', :string # PS:sunetid
34
+ m.field 'ps_career', :string # PS:career
35
+ m.field 'ps_program', :string # PS:program
36
+ m.field 'ps_plan', :string # PS:plan
37
+ m.field 'ps_subplan', :string # PS:subplan
38
+ m.field 'dissertation_id', :string # PS:dissertationid
39
+ m.field 'provost', :string # PS:vpname
43
40
 
44
41
  # from latest ps revision
45
- m.field "degreeconfyr", :string
46
- m.field "schoolname", :string # Display value derived from ps_career
47
- m.field "department", :string # Display value derived from ps_program
48
- m.field "readerapproval", :string # Possible Values: Not Submitted, Not Approved, Approved, Rejected, Reject with Modification
49
- m.field "readercomment", :string
50
- m.field "readeractiondttm", :string # date?
51
- m.field "regapproval", :string # Possible Values: Not Submitted, Not Approved, Approved, Rejected, Reject with Modification
52
- m.field "regcomment", :string
53
- m.field "regactiondttm", :string
54
- m.field "documentaccess", :string
42
+ m.field 'degreeconfyr', :string
43
+ m.field 'schoolname', :string # Display value derived from ps_career
44
+ m.field 'department', :string # Display value derived from ps_program
45
+ m.field 'readerapproval', :string # Possible Values: Not Submitted, Not Approved, Approved, Rejected, Reject with Modification
46
+ m.field 'readercomment', :string
47
+ m.field 'readeractiondttm', :string # date?
48
+ m.field 'regapproval', :string # Possible Values: Not Submitted, Not Approved, Approved, Rejected, Reject with Modification
49
+ m.field 'regcomment', :string
50
+ m.field 'regactiondttm', :string
51
+ m.field 'documentaccess', :string
55
52
 
56
- m.field "submit_date", :string
57
- m.field "symphonyStatus", :string
53
+ m.field 'submit_date', :string
54
+ m.field 'symphonyStatus', :string
58
55
  end
59
56
 
60
- has_metadata :name => "workflow", :type => ActiveFedora::MetadataDatastream do |m|
61
- m.field "citation_verified", :string
62
- m.field "abstract_provided", :string
63
- m.field "dissertation_uploaded", :string
64
- m.field "supplemental_files_uploaded", :string
65
- m.field "permissions_provided", :string
66
- m.field "permission_files_uploaded", :string
67
- m.field "rights_selected", :string
68
- m.field "cc_license_selected", :string
69
- m.field "submitted_to_registrar", :string
57
+ has_metadata :name => 'workflow', :type => ActiveFedora::SimpleDatastream do |m|
58
+ m.field 'citation_verified', :string
59
+ m.field 'abstract_provided', :string
60
+ m.field 'dissertation_uploaded', :string
61
+ m.field 'supplemental_files_uploaded', :string
62
+ m.field 'permissions_provided', :string
63
+ m.field 'permission_files_uploaded', :string
64
+ m.field 'rights_selected', :string
65
+ m.field 'cc_license_selected', :string
66
+ m.field 'submitted_to_registrar', :string
70
67
  end
71
68
 
72
- has_metadata :name => "DC", :type => ActiveFedora::QualifiedDublinCoreDatastream do |m|
69
+ has_metadata :name => 'DC', :type => ActiveFedora::QualifiedDublinCoreDatastream do |m|
73
70
  end
74
-
75
- has_metadata :name => "embargoMetadata", :type => EmbargoMetadataDS
76
- has_metadata :name => 'events', :type => EventsDS
77
71
  end
78
-
79
72
  end
80
-
@@ -1,15 +1,12 @@
1
-
2
-
3
1
  module EtdModel
4
2
  module EtdHelper
5
-
6
3
  def get_embargo_date
7
4
  props_ds = datastreams['properties']
8
5
  regaction = props_ds.regactiondttm_values.first
9
6
  embargo = props_ds.embargo_values.first
10
- if(props_ds.regapproval_values.first =~ /^approved$/i &&
11
- embargo != nil && embargo != '' &&
12
- regaction != nil && regaction != '')
7
+ if props_ds.regapproval_values.first =~ /^approved$/i &&
8
+ !embargo.nil? && embargo != '' &&
9
+ !regaction.nil? && regaction != ''
13
10
  case embargo
14
11
  when /6 months/i
15
12
  embargo_months = 6
@@ -24,6 +21,5 @@ module EtdModel
24
21
  end
25
22
  nil
26
23
  end
27
-
28
24
  end
29
- end
25
+ end
@@ -1,23 +1,16 @@
1
- require 'active_fedora'
2
-
3
1
  module EtdModel
4
-
5
2
  class Part < ActiveFedora::Base
6
-
7
- has_relationship "parents", :is_part_of # relationship between main pdf and parent etd
8
- has_relationship "supplemental_file_for", :is_constituent_of # relationship between supplemental file and parent etd
9
- has_relationship "permission_file_for", :is_dependent_of # relationsihip between permission file and parent etd
10
-
11
- has_metadata :name => "properties", :type => ActiveFedora::MetadataDatastream do |m|
12
- m.field "file_name", :string
13
- m.field "size", :string
14
- m.field "label", :string
15
- end
3
+ belongs_to 'parents', :property => :is_part_of # relationship between main pdf and parent etd
4
+ belongs_to 'supplemental_file_for', :property => :is_constituent_of # relationship between supplemental file and parent etd
5
+ belongs_to 'permission_file_for', :property => :is_dependent_of # relationsihip between permission file and parent etd
16
6
 
17
- has_metadata :name => "DC", :type => ActiveFedora::QualifiedDublinCoreDatastream do |m|
7
+ has_metadata :name => 'properties', :type => ActiveFedora::SimpleDatastream do |m|
8
+ m.field 'file_name', :string
9
+ m.field 'size', :string
10
+ m.field 'label', :string
18
11
  end
19
12
 
13
+ has_metadata :name => 'DC', :type => ActiveFedora::QualifiedDublinCoreDatastream do |m|
14
+ end
20
15
  end
21
-
22
16
  end
23
-
data/lib/etd_model.rb CHANGED
@@ -1,4 +1,7 @@
1
- require 'etd_model/etd_helper'
2
- require 'etd_model/etd'
3
- require 'etd_model/part'
1
+ require 'dor-services'
4
2
 
3
+ module EtdModel
4
+ require 'etd_model/etd_helper'
5
+ require 'etd_model/etd'
6
+ require 'etd_model/part'
7
+ end
metadata CHANGED
@@ -1,211 +1,121 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: etd_model
3
- version: !ruby/object:Gem::Version
4
- hash: 17
5
- prerelease:
6
- segments:
7
- - 1
8
- - 1
9
- - 1
10
- version: 1.1.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.0
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Douglas Kim
14
8
  - Willy Mene
15
9
  autorequire:
16
10
  bindir: bin
17
11
  cert_chain: []
18
-
19
- date: 2011-10-24 00:00:00 -07:00
20
- default_executable:
21
- dependencies:
22
- - !ruby/object:Gem::Dependency
23
- version_requirements: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
26
- - - <
27
- - !ruby/object:Gem::Version
28
- hash: 7
29
- segments:
30
- - 3
31
- - 0
32
- - 0
33
- version: 3.0.0
34
- name: active-fedora
35
- prerelease: false
36
- type: :runtime
37
- requirement: *id001
38
- - !ruby/object:Gem::Dependency
39
- version_requirements: &id002 !ruby/object:Gem::Requirement
40
- none: false
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- hash: 5
45
- segments:
46
- - 2
47
- - 2
48
- - 1
49
- version: 2.2.1
12
+ date: 2016-01-21 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
50
15
  name: dor-services
51
- prerelease: false
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '5.3'
52
21
  type: :runtime
53
- requirement: *id002
54
- - !ruby/object:Gem::Dependency
55
- version_requirements: &id003 !ruby/object:Gem::Requirement
56
- none: false
57
- requirements:
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- hash: 25
61
- segments:
62
- - 0
63
- - 1
64
- - 1
65
- version: 0.1.1
66
- name: lyberteam-devel
67
22
  prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: '5.3'
28
+ - !ruby/object:Gem::Dependency
29
+ name: coveralls
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
68
35
  type: :development
69
- requirement: *id003
70
- - !ruby/object:Gem::Dependency
71
- version_requirements: &id004 !ruby/object:Gem::Requirement
72
- none: false
73
- requirements:
74
- - - "="
75
- - !ruby/object:Gem::Version
76
- hash: 3
77
- segments:
78
- - 0
79
- - 4
80
- version: "0.4"
81
- name: mediashelf-loggable
82
36
  prerelease: false
83
- type: :development
84
- requirement: *id004
85
- - !ruby/object:Gem::Dependency
86
- version_requirements: &id005 !ruby/object:Gem::Requirement
87
- none: false
88
- requirements:
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
89
39
  - - ">="
90
- - !ruby/object:Gem::Version
91
- hash: 49
92
- segments:
93
- - 0
94
- - 8
95
- - 7
96
- version: 0.8.7
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ - !ruby/object:Gem::Dependency
97
43
  name: rake
98
- prerelease: false
99
- type: :development
100
- requirement: *id005
101
- - !ruby/object:Gem::Dependency
102
- version_requirements: &id006 !ruby/object:Gem::Requirement
103
- none: false
104
- requirements:
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
105
46
  - - ">="
106
- - !ruby/object:Gem::Version
107
- hash: 3
108
- segments:
109
- - 0
110
- version: "0"
111
- name: rcov
112
- prerelease: false
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
113
49
  type: :development
114
- requirement: *id006
115
- - !ruby/object:Gem::Dependency
116
- version_requirements: &id007 !ruby/object:Gem::Requirement
117
- none: false
118
- requirements:
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
119
53
  - - ">="
120
- - !ruby/object:Gem::Version
121
- hash: 3
122
- segments:
123
- - 0
124
- version: "0"
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ - !ruby/object:Gem::Dependency
125
57
  name: rdoc
126
- prerelease: false
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
127
63
  type: :development
128
- requirement: *id007
129
- - !ruby/object:Gem::Dependency
130
- version_requirements: &id008 !ruby/object:Gem::Requirement
131
- none: false
132
- requirements:
133
- - - <
134
- - !ruby/object:Gem::Version
135
- hash: 3
136
- segments:
137
- - 2
138
- - 0
139
- version: "2.0"
140
- name: rspec
141
64
  prerelease: false
142
- type: :development
143
- requirement: *id008
144
- - !ruby/object:Gem::Dependency
145
- version_requirements: &id009 !ruby/object:Gem::Requirement
146
- none: false
147
- requirements:
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
148
67
  - - ">="
149
- - !ruby/object:Gem::Version
150
- hash: 3
151
- segments:
152
- - 0
153
- version: "0"
154
- name: ruby-debug
155
- prerelease: false
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: rspec
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: '3.0'
156
77
  type: :development
157
- requirement: *id009
158
- description: Contains classes that define the Fedora content model for electronic theses and dissertations.
159
- email:
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: '3.0'
84
+ description: Contains classes that define the Fedora content model for electronic
85
+ theses and dissertations.
86
+ email:
160
87
  - wmene@stanford.edu
161
88
  executables: []
162
-
163
89
  extensions: []
164
-
165
90
  extra_rdoc_files: []
166
-
167
- files:
91
+ files:
92
+ - LICENSE
93
+ - README.md
94
+ - lib/etd_model.rb
168
95
  - lib/etd_model/etd.rb
169
96
  - lib/etd_model/etd_helper.rb
170
97
  - lib/etd_model/part.rb
171
- - lib/etd_model.rb
172
- - LICENSE
173
- - README.rdoc
174
- has_rdoc: true
175
98
  homepage:
176
99
  licenses: []
177
-
100
+ metadata: {}
178
101
  post_install_message:
179
102
  rdoc_options: []
180
-
181
- require_paths:
103
+ require_paths:
182
104
  - lib
183
- required_ruby_version: !ruby/object:Gem::Requirement
184
- none: false
185
- requirements:
105
+ required_ruby_version: !ruby/object:Gem::Requirement
106
+ requirements:
186
107
  - - ">="
187
- - !ruby/object:Gem::Version
188
- hash: 3
189
- segments:
190
- - 0
191
- version: "0"
192
- required_rubygems_version: !ruby/object:Gem::Requirement
193
- none: false
194
- requirements:
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ required_rubygems_version: !ruby/object:Gem::Requirement
111
+ requirements:
195
112
  - - ">="
196
- - !ruby/object:Gem::Version
197
- hash: 23
198
- segments:
199
- - 1
200
- - 3
201
- - 6
202
- version: 1.3.6
113
+ - !ruby/object:Gem::Version
114
+ version: '0'
203
115
  requirements: []
204
-
205
116
  rubyforge_project:
206
- rubygems_version: 1.5.2
117
+ rubygems_version: 2.4.6
207
118
  signing_key:
208
- specification_version: 3
119
+ specification_version: 4
209
120
  summary: ETD content model used by the SULAIR Digital Library
210
121
  test_files: []
211
-
data/README.rdoc DELETED
@@ -1,19 +0,0 @@
1
- == etd_model
2
-
3
- This gem provides the ActiveFedora::MetadataDatastream declarations for Etd and its corresponding Part object, enabling the hydra_etd webapp
4
- and the etd-robots to share code. The projects should derive their own local versions of Etd.
5
-
6
- Common methods should be added to the EtdModel::EtdHelper.
7
-
8
- == Releases
9
- - 1.1.0 Added embargoMetadata and events datastreams to the Etd model
10
- - 1.0.0 Gem built without Jeweler. Using bundler and rvm.
11
- - 0.0.3.1 Handle term element with Active Fedora 1.2.6
12
- - 0.0.3 Updated to use Active Fedora 1.2.6
13
- - 0.0.2.1 Handle term element. Last version compatible with active_fedora 1.1.13
14
- - 0.0.2 Moved #get_embargo_date method from the hydra_etd app to the EtdModel::EtdHelper module
15
- - 0.0.1 Initial release
16
-
17
- == Copyright
18
-
19
- Copyright (c) 2011 Stanford University Library. See LICENSE for details.