hydra-pbcore 3.2.0 → 3.3.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.
- data/lib/hydra_pbcore/datastream/document.rb +19 -9
- data/lib/hydra_pbcore/version.rb +1 -1
- data/spec/document_spec.rb +61 -1
- data/spec/fixtures/document_solr.xml +9 -6
- data/spec/methods_spec.rb +1 -1
- metadata +8 -2
| @@ -94,20 +94,30 @@ class Document < ActiveFedora::OmDatastream | |
| 94 94 | 
             
                )
         | 
| 95 95 |  | 
| 96 96 | 
             
                # PBCore relation fields
         | 
| 97 | 
            -
                t.pbcoreRelation do
         | 
| 97 | 
            +
                t.relation(:path => "pbcoreRelation") do
         | 
| 98 98 | 
             
                  t.event_series(:path=>"pbcoreRelationIdentifier", :attributes=>{ :annotation=>"Event Series" })
         | 
| 99 | 
            -
                  t. | 
| 100 | 
            -
             | 
| 99 | 
            +
                  t.collection(:path=>"pbcoreRelationIdentifier", :attributes=>{ :annotation=>"Archival Collection" }) do
         | 
| 100 | 
            +
                    t.uri(:path => {:attribute => "ref"})
         | 
| 101 | 
            +
                    t.authority(:path => {:attribute => "source"})
         | 
| 102 | 
            +
                  end
         | 
| 103 | 
            +
                  t.series(:path=>"pbcoreRelationIdentifier", :attributes=>{ :annotation=>"Archival Series" }) do
         | 
| 104 | 
            +
                    t.uri(:path => {:attribute => "ref"})
         | 
| 105 | 
            +
                    t.authority(:path => {:attribute => "source"})
         | 
| 106 | 
            +
                  end
         | 
| 101 107 | 
             
                  t.coll_num(:path=>"pbcoreRelationIdentifier", :attributes=>{ :annotation=>"Collection Number" })
         | 
| 102 108 | 
             
                  t.acc_num(:path=>"pbcoreRelationIdentifier", :attributes=>{ :annotation=>"Accession Number" })
         | 
| 103 109 | 
             
                  t.addl_coll(:path=>"pbcoreRelationIdentifier", :attributes=>{ :annotation=>"Additional Collection" })
         | 
| 104 110 | 
             
                end
         | 
| 105 | 
            -
                t.series(:ref=>[: | 
| 106 | 
            -
                t.collection(:ref=>[: | 
| 107 | 
            -
                t. | 
| 108 | 
            -
                t. | 
| 109 | 
            -
                t. | 
| 110 | 
            -
                t. | 
| 111 | 
            +
                t.series(:ref=>[:relation, :event_series], :index_as => [:searchable, :displayable, :facetable])
         | 
| 112 | 
            +
                t.collection(:ref=>[:relation, :collection], :index_as => [:searchable, :displayable, :facetable])
         | 
| 113 | 
            +
                t.collection_uri(:proxy=>[:relation, :collection, :uri], :index_as => [:displayable])
         | 
| 114 | 
            +
                t.collection_authority(:proxy=>[:relation, :collection, :authority], :index_as => [:displayable])
         | 
| 115 | 
            +
                t.archival_series(:ref=>[:relation, :series], :index_as => [:searchable, :displayable, :facetable])
         | 
| 116 | 
            +
                t.archival_series_uri(:proxy=>[:relation, :series, :uri], :index_as => [:displayable])
         | 
| 117 | 
            +
                t.archival_series_authority(:proxy=>[:relation, :series, :authority], :index_as => [:displayable])
         | 
| 118 | 
            +
                t.additional_collection(:ref=>[:relation, :addl_coll], :index_as => [:searchable, :displayable, :facetable])
         | 
| 119 | 
            +
                t.collection_number(:ref=>[:relation, :coll_num], :index_as => [:searchable, :displayable])
         | 
| 120 | 
            +
                t.accession_number(:ref=>[:relation, :acc_num], :index_as => [:searchable, :displayable])
         | 
| 111 121 |  | 
| 112 122 | 
             
                t.pbcoreCoverage
         | 
| 113 123 | 
             
                # Terms for time and place
         | 
    
        data/lib/hydra_pbcore/version.rb
    CHANGED
    
    
    
        data/spec/document_spec.rb
    CHANGED
    
    | @@ -263,6 +263,66 @@ describe HydraPbcore::Datastream::Document do | |
| 263 263 |  | 
| 264 264 | 
             
                end
         | 
| 265 265 |  | 
| 266 | 
            -
              end | 
| 266 | 
            +
              end
         | 
| 267 | 
            +
             | 
| 268 | 
            +
              describe "#collection_uri" do
         | 
| 269 | 
            +
                it "should return the uri of the collection" do
         | 
| 270 | 
            +
                  @object_ds.is_part_of("Collection", {:annotation => "Archival Collection", :ref => "http://foo"})
         | 
| 271 | 
            +
                  @object_ds.collection.should == ["Collection"]
         | 
| 272 | 
            +
                  @object_ds.collection_uri.should == ["http://foo"]
         | 
| 273 | 
            +
                end
         | 
| 274 | 
            +
                it "should update the uri of a collection" do
         | 
| 275 | 
            +
                  @object_ds.is_part_of("Collection", {:annotation => "Archival Collection"})
         | 
| 276 | 
            +
                  @object_ds.collection_uri.should be_empty
         | 
| 277 | 
            +
                  @object_ds.relation.collection.uri = "http://foo"
         | 
| 278 | 
            +
                  @object_ds.collection_uri.should == ["http://foo"]
         | 
| 279 | 
            +
                  @object_ds.valid?.should be_true
         | 
| 280 | 
            +
                end
         | 
| 281 | 
            +
              end
         | 
| 282 | 
            +
             | 
| 283 | 
            +
              describe "#collection_authority" do
         | 
| 284 | 
            +
                it "should return the authority of the collection" do
         | 
| 285 | 
            +
                  @object_ds.is_part_of("Collection", {:annotation => "Archival Collection", :source => "Foo"})
         | 
| 286 | 
            +
                  @object_ds.collection.should == ["Collection"]
         | 
| 287 | 
            +
                  @object_ds.collection_authority.should == ["Foo"]
         | 
| 288 | 
            +
                end
         | 
| 289 | 
            +
                it "should update the authority of a collection" do
         | 
| 290 | 
            +
                  @object_ds.is_part_of("Collection", {:annotation => "Archival Collection"})
         | 
| 291 | 
            +
                  @object_ds.collection_authority.should be_empty
         | 
| 292 | 
            +
                  @object_ds.relation.collection.authority = "Foo!"
         | 
| 293 | 
            +
                  @object_ds.collection_authority.should == ["Foo!"]
         | 
| 294 | 
            +
                  @object_ds.valid?.should be_true
         | 
| 295 | 
            +
                end
         | 
| 296 | 
            +
              end
         | 
| 297 | 
            +
             | 
| 298 | 
            +
              describe "#archival_series_uri" do
         | 
| 299 | 
            +
                it "should return the uri of the archival_series" do
         | 
| 300 | 
            +
                  @object_ds.is_part_of("Series", {:annotation => "Archival Series", :ref => "http://foo"})
         | 
| 301 | 
            +
                  @object_ds.archival_series.should == ["Series"]
         | 
| 302 | 
            +
                  @object_ds.archival_series_uri.should == ["http://foo"]
         | 
| 303 | 
            +
                end
         | 
| 304 | 
            +
                it "should update the uri of a archival_series" do
         | 
| 305 | 
            +
                  @object_ds.is_part_of("Series", {:annotation => "Archival Series"})
         | 
| 306 | 
            +
                  @object_ds.archival_series_uri.should be_empty
         | 
| 307 | 
            +
                  @object_ds.relation.series.uri = "http://foo"
         | 
| 308 | 
            +
                  @object_ds.archival_series_uri.should == ["http://foo"]
         | 
| 309 | 
            +
                  @object_ds.valid?.should be_true
         | 
| 310 | 
            +
                end
         | 
| 311 | 
            +
              end
         | 
| 312 | 
            +
             | 
| 313 | 
            +
              describe "#archival_series_authority" do
         | 
| 314 | 
            +
                it "should return the authority of the archival_series" do
         | 
| 315 | 
            +
                  @object_ds.is_part_of("Series", {:annotation => "Archival Series", :source => "Foo"})
         | 
| 316 | 
            +
                  @object_ds.archival_series.should == ["Series"]
         | 
| 317 | 
            +
                  @object_ds.archival_series_authority.should == ["Foo"]
         | 
| 318 | 
            +
                end
         | 
| 319 | 
            +
                it "should update the authority of a archival_series" do
         | 
| 320 | 
            +
                  @object_ds.is_part_of("Series", {:annotation => "Archival Series"})
         | 
| 321 | 
            +
                  @object_ds.archival_series_authority.should be_empty
         | 
| 322 | 
            +
                  @object_ds.relation.series.authority = "Foo!"
         | 
| 323 | 
            +
                  @object_ds.archival_series_authority.should == ["Foo!"]
         | 
| 324 | 
            +
                  @object_ds.valid?.should be_true
         | 
| 325 | 
            +
                end
         | 
| 326 | 
            +
              end
         | 
| 267 327 |  | 
| 268 328 | 
             
            end
         | 
| @@ -400,6 +400,15 @@ | |
| 400 400 | 
             
              <collection-sim type="array">
         | 
| 401 401 | 
             
                <collection-sim>inserted</collection-sim>
         | 
| 402 402 | 
             
              </collection-sim>
         | 
| 403 | 
            +
              <archival-series-teim type="array">
         | 
| 404 | 
            +
                <archival-series-teim>inserted</archival-series-teim>
         | 
| 405 | 
            +
              </archival-series-teim>
         | 
| 406 | 
            +
              <archival-series-ssm type="array">
         | 
| 407 | 
            +
                <archival-series-ssm>inserted</archival-series-ssm>
         | 
| 408 | 
            +
              </archival-series-ssm>
         | 
| 409 | 
            +
              <archival-series-sim type="array">
         | 
| 410 | 
            +
                <archival-series-sim>inserted</archival-series-sim>
         | 
| 411 | 
            +
              </archival-series-sim>
         | 
| 403 412 | 
             
              <additional-collection-teim type="array">
         | 
| 404 413 | 
             
                <additional-collection-teim>inserted</additional-collection-teim>
         | 
| 405 414 | 
             
              </additional-collection-teim>
         | 
| @@ -409,12 +418,6 @@ | |
| 409 418 | 
             
              <additional-collection-sim type="array">
         | 
| 410 419 | 
             
                <additional-collection-sim>inserted</additional-collection-sim>
         | 
| 411 420 | 
             
              </additional-collection-sim>
         | 
| 412 | 
            -
              <archival-series-teim type="array">
         | 
| 413 | 
            -
                <archival-series-teim>inserted</archival-series-teim>
         | 
| 414 | 
            -
              </archival-series-teim>
         | 
| 415 | 
            -
              <archival-series-ssm type="array">
         | 
| 416 | 
            -
                <archival-series-ssm>inserted</archival-series-ssm>
         | 
| 417 | 
            -
              </archival-series-ssm>
         | 
| 418 421 | 
             
              <collection-number-teim type="array">
         | 
| 419 422 | 
             
                <collection-number-teim>inserted</collection-number-teim>
         | 
| 420 423 | 
             
              </collection-number-teim>
         | 
    
        data/spec/methods_spec.rb
    CHANGED
    
    | @@ -19,7 +19,7 @@ describe HydraPbcore::Methods do | |
| 19 19 | 
             
                  @object.is_part_of("foo", {:annotation => "Archival Collection"})
         | 
| 20 20 | 
             
                  @object.collection.first.should == "foo"
         | 
| 21 21 | 
             
                  @object.remove_node :collection, 0, {:include_parent? => TRUE} 
         | 
| 22 | 
            -
                  @object.find_by_terms(: | 
| 22 | 
            +
                  @object.find_by_terms(:relation).should be_empty
         | 
| 23 23 | 
             
                end
         | 
| 24 24 |  | 
| 25 25 | 
             
              end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: hydra-pbcore
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 3. | 
| 4 | 
            +
              version: 3.3.0
         | 
| 5 5 | 
             
              prerelease: 
         | 
| 6 6 | 
             
            platform: ruby
         | 
| 7 7 | 
             
            authors:
         | 
| @@ -9,7 +9,7 @@ authors: | |
| 9 9 | 
             
            autorequire: 
         | 
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2013-10- | 
| 12 | 
            +
            date: 2013-10-25 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: active-fedora
         | 
| @@ -223,12 +223,18 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 223 223 | 
             
              - - ! '>='
         | 
| 224 224 | 
             
                - !ruby/object:Gem::Version
         | 
| 225 225 | 
             
                  version: '0'
         | 
| 226 | 
            +
                  segments:
         | 
| 227 | 
            +
                  - 0
         | 
| 228 | 
            +
                  hash: -719992496300359709
         | 
| 226 229 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 227 230 | 
             
              none: false
         | 
| 228 231 | 
             
              requirements:
         | 
| 229 232 | 
             
              - - ! '>='
         | 
| 230 233 | 
             
                - !ruby/object:Gem::Version
         | 
| 231 234 | 
             
                  version: '0'
         | 
| 235 | 
            +
                  segments:
         | 
| 236 | 
            +
                  - 0
         | 
| 237 | 
            +
                  hash: -719992496300359709
         | 
| 232 238 | 
             
            requirements: []
         | 
| 233 239 | 
             
            rubyforge_project: 
         | 
| 234 240 | 
             
            rubygems_version: 1.8.23
         |