-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial experiment with adding external dcp resources as items
- Loading branch information
Showing
5 changed files
with
57 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class DigitalCollectionsResourcesController < Spotlight::ResourcesController | ||
private | ||
|
||
def resource_class | ||
DigitalCollectionsResource | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
class DigitalCollectionsResource < Spotlight::Resource | ||
# TODO: What is this indexing pipeline | ||
def self.indexing_pipeline | ||
@indexing_pipeline ||= super.dup.tap do |pipeline| | ||
pipeline.transforms = [Spotlight::Etl::Sources::SourceMethodSource(:to_solr)] + pipeline.transforms | ||
|
||
# PR for implementing an ETL-like pattern for indexing documents | ||
# https://github.com/projectblacklight/spotlight/pull/2625 | ||
# # if, say, you wanted to feed the transform with multiple source documents | ||
# # (here, by calling the `#iiif_manifest` method on the DlmeJson instance); | ||
# # previously, the #to_solr method of the document builder would have done this extraction | ||
# # pipeline.sources = [Spotlight::Etl::Sources::SourceMethodSource(:iiif_manifests)] | ||
# pipeline.transforms = [ | ||
# ->(data, p) { data.merge(DlmeJsonResourceBuilder.new(p.context.resoure).to_solr) } | ||
# ] | ||
|
||
# Spotlight::Resource::IiifHarvester | ||
# pipeline.sources = [Spotlight::Etl::Sources::SourceMethodSource(:iiif_manifests)] | ||
# pipeline.transforms = [ | ||
# ->(data, p) { data.merge(p.source.to_solr(exhibit: p.context.resource.exhibit)) } | ||
# ] + pipeline.transforms | ||
|
||
# Spotlight::Resource::JsonUpload | ||
# pipeline.sources = [Spotlight::Etl::Sources::StoredData] | ||
# pipeline.transforms = [ | ||
# Spotlight::Etl::Transforms::IdentityTransform | ||
# ] + pipeline.transforms | ||
end | ||
end | ||
|
||
def to_solr | ||
# TODO | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<%= bootstrap_form_for([current_exhibit, @resource.becomes(DigitalCollectionsResource)], as: :resource) do |f| %> | ||
<%= f.text_field :url %> | ||
<div class="form-actions"> | ||
<div class="primary-actions"> | ||
<%= cancel_link @resource, :back, class: 'btn btn-secondary' %> | ||
<%= f.submit t('.add_item'), class: 'btn btn-primary' %> | ||
</div> | ||
</div> | ||
<% end if can? :manage, @resource %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters