cul_hydra 1.0.0 → 1.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9669d16a11214de3beece7b70f8f270c9c3e6f74
4
- data.tar.gz: b029e107109a3d13720dc03a026b2a855af76a25
3
+ metadata.gz: f781b50741ba5033e8befb86f7c1258250016592
4
+ data.tar.gz: d3d5888a4e3c74576d238bba68fa68773c699cc9
5
5
  SHA512:
6
- metadata.gz: 8abbcd3eca758e1057983a6bea70b1bbe076c33151044743fd05725f699d4eabe202370bced90839571b86150823227037cf6d884489c2ea741788dc0d402553
7
- data.tar.gz: 49be88f1af4b2612432942a8a6e706dea75d1d05218e1e3623ce440b1e52462aaf641bfab541f74448e9a16b1598a2b2c751a93c98c0bf22dc28e8036669517c
6
+ metadata.gz: 5197dbc0e00ce674ee31892589c6e40bc23063ad4ad46cb49a674bbdd0b8a4e87c822290f44d19ca92885aa2585b91c8ed34a321a7e4734022c8a25205c613ce
7
+ data.tar.gz: c535c795331b38e79d1b1e87a2ae0ceb151e1fcbaf4943bc8bfdc9968d0459a15f82c8647c563765d953d39378ea57f103aeb5bb4b197f202df106f330906202
@@ -87,6 +87,38 @@ module ClassMethods
87
87
  count = get_project_constituent_results(pid,verbose_output,'count/json')
88
88
  return count.blank? ? 0 : count[0]['count'].to_i
89
89
  end
90
+
91
+ #Publish target members
92
+
93
+ def get_publish_target_member_results(pid, verbose_output=false, format='json')
94
+
95
+ project_constituent_query =
96
+ 'select $pid from <#ri>
97
+ where $pid <http://purl.org/dc/terms/publisher> <fedora:' + pid + '>'
98
+
99
+ puts 'Performing query:' if verbose_output
100
+ puts project_constituent_query if verbose_output
101
+
102
+ search_response = JSON(Cul::Hydra::Fedora.repository.find_by_itql(project_constituent_query, {
103
+ :type => 'tuples',
104
+ :format => format,
105
+ :limit => '',
106
+ :stream => 'on'
107
+ }))
108
+
109
+ return search_response['results']
110
+ end
111
+
112
+ def get_publish_target_member_pids(pid, verbose_output=false)
113
+ unique_pids = get_publish_target_member_results(pid,verbose_output,'json')
114
+ unique_pids.map{|result| result['pid'].gsub('info:fedora/', '') }.uniq
115
+ end
116
+
117
+ def get_publish_target_member_count(pid, verbose_output=false)
118
+ count = get_publish_target_member_results(pid,verbose_output,'count/json')
119
+ return count.blank? ? 0 : count[0]['count'].to_i
120
+ end
121
+
90
122
  end
91
123
  extend ClassMethods
92
124
  end
@@ -1,6 +1,6 @@
1
1
  module Cul
2
2
  module Hydra
3
- VERSION = '1.0.0'
3
+ VERSION = '1.0.1'
4
4
  def self.version
5
5
  VERSION
6
6
  end
@@ -1,6 +1,6 @@
1
1
  module Cul
2
2
  module Hydra
3
- VERSION = '0.22.9.10'
3
+ VERSION = '1.0.0'
4
4
  def self.version
5
5
  VERSION
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cul_hydra
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Armintor
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-04-27 00:00:00.000000000 Z
12
+ date: 2015-05-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: blacklight
@@ -501,3 +501,4 @@ signing_key:
501
501
  specification_version: 4
502
502
  summary: ActiveFedora, OM, and Solrizer implementations for CUL repository apps
503
503
  test_files: []
504
+ has_rdoc: