README.md in valkyrie-2.0.0.RC3 vs README.md in valkyrie-2.0.0.RC4

- old
+ new

@@ -3,17 +3,16 @@ Valkyrie is a gem for enabling multiple backends for storage of files and metadata in Samvera. ![Valkyrie Logo](valkyrie_logo.png) Code: [![Version](https://badge.fury.io/rb/valkyrie.png)](http://badge.fury.io/rb/valkyrie) -[![Build Status](https://circleci.com/gh/samvera-labs/valkyrie.svg?style=svg)](https://circleci.com/gh/samvera-labs/valkyrie) -[![Coverage Status](https://coveralls.io/repos/github/samvera-labs/valkyrie/badge.svg?branch=master)](https://coveralls.io/github/samvera-labs/valkyrie?branch=master) -[![Stories in Ready](https://badge.waffle.io/samvera-labs/valkyrie.png?label=ready&title=Ready)](https://waffle.io/samvera-labs/valkyrie) +[![Build Status](https://circleci.com/gh/samvera/valkyrie.svg?style=svg)](https://circleci.com/gh/samvera/valkyrie) +![Coverage Status](https://img.shields.io/badge/Coverage-100-brightgreen.svg) Docs: [![Contribution Guidelines](http://img.shields.io/badge/CONTRIBUTING-Guidelines-blue.svg)](./CONTRIBUTING.md) [![Apache 2.0 License](http://img.shields.io/badge/APACHE2-license-blue.svg)](./LICENSE) -[![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://rubydoc.info/github/samvera-labs/valkyrie) +[![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://rubydoc.info/gems/valkyrie) Jump in: [![Slack Status](http://slack.samvera.org/badge.svg)](http://slack.samvera.org/) ## Primary Contacts @@ -60,11 +59,29 @@ Valkyrie::MetadataAdapter.register( Valkyrie::Persistence::Postgres::MetadataAdapter.new, :postgres ) + # To use the solr adapter you must add gem 'rsolr' to your Gemfile Valkyrie::MetadataAdapter.register( + Valkyrie::Persistence::Solr::MetadataAdapter.new( + connection: Blacklight.default_index.connection + ), + :solr + ) + + # To use the fedora adapter you must add `gem 'ldp'` to your Gemfile + Valkyrie::MetadataAdapter.register( + Valkyrie::Persistence::Fedora::MetadataAdapter.new( + connection: ::Ldp::Client.new("http://localhost:8988/rest"), + base_path: "test_fed", + schema: Valkyrie::Persistence::Fedora::PermissiveSchema.new(title: RDF::URI("http://bad.com/title")) + ), + :fedora + ) + + Valkyrie::MetadataAdapter.register( Valkyrie::Persistence::Memory::MetadataAdapter.new, :memory ) Valkyrie::StorageAdapter.register( @@ -83,12 +100,14 @@ :memory ) end ``` -The initializer registers two `Valkyrie::MetadataAdapter` instances for storing metadata: +The initializer registers four `Valkyrie::MetadataAdapter` instances for storing metadata: * `:postgres` which stores metadata in a PostgreSQL database +* `:solr` which stores metadata in a Solr Index +* `:fedora` which stores metadata in a Fedora server. * `:memory` which stores metadata in an in-memory cache (this cache is not persistent, so it is only appropriate for testing) Other adapter options include `Valkyrie::Persistence::BufferedPersister` for buffering in memory before bulk updating another persister, `Valkyrie::Persistence::CompositePersister` for storing in more than one adapter @@ -133,11 +152,11 @@ * `storage_adapter` is the store where Valkyrie will put the files The values are the short names used in your initializer. Further details can be found on the [Persistence Wiki -page](https://github.com/samvera-labs/valkyrie/wiki/Persistence). +page](https://github.com/samvera/valkyrie/wiki/Persistence). ## Usage ### Define a Custom Work Define a custom work class: @@ -157,11 +176,11 @@ ``` attribute :authors, Valkyrie::Types::Array.meta(ordered: true) ``` Defining resource attributes is explained in greater detail on the [Using Types Wiki -page](https://github.com/samvera-labs/valkyrie/wiki/Using-Types). +page](https://github.com/samvera/valkyrie/wiki/Using-Types). #### Work Types Generator To create a custom Valkyrie model in your application, you can use the Rails generator. For example, to generate a model named `FooBar` with an unordered `title` field and an ordered `member_ids` field: @@ -193,20 +212,20 @@ # load all MyModel objects Valkyrie.config.metadata_adapter.query_service.find_all_of_model(model: MyModel) ``` -The Wiki documents the usage of [Queries](https://github.com/samvera-labs/valkyrie/wiki/Queries), -[Persistence](https://github.com/samvera-labs/valkyrie/wiki/Persistence), and -[ChangeSets and Dirty Tracking](https://github.com/samvera-labs/valkyrie/wiki/ChangeSets-and-Dirty-Tracking). +The Wiki documents the usage of [Queries](https://github.com/samvera/valkyrie/wiki/Queries), +[Persistence](https://github.com/samvera/valkyrie/wiki/Persistence), and +[ChangeSets and Dirty Tracking](https://github.com/samvera/valkyrie/wiki/ChangeSets-and-Dirty-Tracking). ### Concurrency Support A Valkyrie repository may have concurrent updates, for example, from a load-balanced Rails application, or from multiple [Sidekiq](https://github.com/mperham/sidekiq) background workers). In order to prevent multiple simultaneous updates applied to the same resource from losing or corrupting data, Valkyrie supports optimistic locking. How to use optimistic locking with Valkyrie is documented on the [Optimistic Locking Wiki -page](https://github.com/samvera-labs/valkyrie/wiki/Optimistic-Locking). +page](https://github.com/samvera/valkyrie/wiki/Optimistic-Locking). ### The Public API Valkyrie's public API is defined by the shared specs that are used to test each of its core classes. This include change sets, resources, persisters, adapters, and queries. When creating your own kinds of these kinds of classes, you should use these shared specs to test your classes for conformance to @@ -216,11 +235,11 @@ this. When new features are added and a minor version is released there will be no change to the existing shared specs, but there may be new ones. These new shared specs will fail in your application if you have custom adapters, but your application will still work. Using the shared specs in your own models is described in more detail on the [Shared Specs Wiki -page](https://github.com/samvera-labs/valkyrie/wiki/Shared-Specs). +page](https://github.com/samvera/valkyrie/wiki/Shared-Specs). ### Fedora 5 Compatibility When configuring your adapter, include the `fedora_version` parameter in your metadata or storage adapter config. If Fedora requires auth, you can also include that in the URL, e.g.: @@ -288,6 +307,6 @@ ![Samvera Logo](https://wiki.duraspace.org/download/thumbnails/87459292/samvera-fall-font2-200w.png?version=1&modificationDate=1498550535816&api=v2) ## Contributing -Bug reports and pull requests are welcome on GitHub at https://github.com/samvera-labs/valkyrie/. +Bug reports and pull requests are welcome on GitHub at https://github.com/samvera/valkyrie/.