Skip to content
This repository has been archived by the owner on May 14, 2022. It is now read-only.

Commit

Permalink
Integrate with GeoConcerns (#837)
Browse files Browse the repository at this point in the history
* add geo_concerns to Gemfile
* install GeoConcerns
* add simple-tiles dependencies to circleci
* remove geo_concerns fileset presenter behavior
* generate thumbnail paths for geo works
* skip removal of pending uploads for objects that don't respond to pending_uploads
* add geo extensions to PairtreeDerivativePath
* update to geo_concerns 0.2.0
* trigger manifest event in file set actor only if parent is not a geo work
* reorganize welcome page to accommodate geo works
* add icons to works on welcome page
* change work-icons src to font-url
* add staging to geoconcerns messaging config file
* upgrade to geo_concerns v0.3.0
* use ark noid in gbl slug
* create separate geo derivatives path
* index thumbnail path in geo works using local thumbnail path service
* change bbox label color to black
* upgrade to geo_concerns v0.3.1 (#880)
* add shared geo-derivatives directory to capistrano (#881)
* override the geo_concerns metadata_xml method on file set (#884)
* add local presenters for geo works
* add local forms for geo works
* add metadata for geo works and put state behavior in separate module
* add state and rights_statement geo work views
* add flagging to geo works and put flagging behavior in separate module
* extract common presenter methods into module
* upgrade to geo_concerns v0.3.2 (#889)
* override geoserver delivery service base path method (#888)
* Fix Geoblacklight document generation (#891)
* set different provenance for geoblacklight documents
* upgrade to geo_concerns v0.3.3
* use curation concern base view partials for geo file manager
* add geo works to collections in the same way as other works (#904)
* limit number of subjects displayed on index page (#907)
* fire geo works events only when state is complete (#909)
  • Loading branch information
eliotjordan authored and escowles committed Jan 4, 2017
1 parent 31d2c4c commit 90a1315
Show file tree
Hide file tree
Showing 123 changed files with 1,528 additions and 157 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ gem 'rsolr', '~> 1.1.0'
gem 'devise', '~> 3.0'
gem 'devise-guests', '~> 0.3'
gem 'iiif-presentation', github: 'iiif/osullivan', branch: 'development'
gem 'geo_concerns', '~> 0.3.3'

# PDF generation
gem 'prawn'
Expand Down
43 changes: 42 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ GEM
execjs
coffee-script-source (1.10.0)
concurrent-ruby (1.0.2)
confstruct (0.2.7)
connection_pool (2.2.0)
coveralls (0.8.3)
json (~> 1.8)
Expand All @@ -253,6 +254,7 @@ GEM
safe_yaml (~> 1.0.0)
daemons (1.2.4)
dalli (2.7.6)
dbf (3.0.8)
debug_inspector (0.0.2)
deprecation (1.0.0)
activesupport
Expand Down Expand Up @@ -290,6 +292,18 @@ GEM
ffi (1.9.14)
font-awesome-rails (4.7.0.0)
railties (>= 3.2, < 5.1)
geo_concerns (0.3.3)
bunny
curation_concerns (>= 1.6)
geoblacklight_messaging
jquery-ui-rails (~> 5.0.5)
json-schema (>= 2.6.2)
leaflet-rails (~> 0.7)
rgeoserver (>= 0.10.0)
simpler-tiles
geoblacklight_messaging (0.2.0)
rails (>= 4.2.7.1)
sneakers
globalid (0.3.7)
activesupport (>= 4.1.0)
google-api-client (0.9.19)
Expand Down Expand Up @@ -386,6 +400,8 @@ GEM
json-ld (2.1.0)
multi_json (~> 1.11)
rdf (~> 2.1)
json-schema (2.7.0)
addressable (>= 2.4)
jwt (1.5.6)
kaminari (0.17.0)
actionpack (>= 3.0.0)
Expand All @@ -404,6 +420,7 @@ GEM
rdf-turtle
rdf-vocab (>= 0.8)
slop
leaflet-rails (0.7.7)
link_header (0.0.8)
little-plugger (1.1.4)
logging (2.1.0)
Expand Down Expand Up @@ -551,6 +568,19 @@ GEM
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
retriable (2.1.0)
rgeo (0.5.3)
rgeo-shapefile (0.4.1)
dbf (~> 3.0)
rgeo (~> 0.3)
rgeoserver (0.10.0)
activemodel
activesupport
confstruct (~> 0.2.7)
nokogiri
rest-client
rgeo (~> 0.5.3)
rgeo-shapefile (~> 0.4.1)
rubyzip
rsolr (1.1.2)
builder (>= 2.1.2)
rspec-core (3.5.3)
Expand Down Expand Up @@ -598,11 +628,14 @@ GEM
sdoc (0.4.1)
json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0)
serverengine (2.0.4)
sigdump (~> 0.2.2)
sidekiq (4.2.3)
concurrent-ruby (~> 1.0)
connection_pool (~> 2.2, >= 2.2.0)
rack-protection (>= 1.5.0)
redis (~> 3.2, >= 3.2.1)
sigdump (0.2.4)
signet (0.7.3)
addressable (~> 2.3)
faraday (~> 0.9)
Expand All @@ -616,6 +649,7 @@ GEM
json (~> 1.8)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
simpler-tiles (0.3.1)
sinatra (1.4.7)
rack (~> 1.5)
rack-protection (~> 1.4)
Expand All @@ -626,6 +660,11 @@ GEM
httparty (>= 0.11.0)
oauth2 (>= 0.9.2)
slop (3.6.0)
sneakers (0.0.7)
bunny (>= 0.10.0)
serverengine
thor
thread
solr_wrapper (0.18.0)
faraday
ruby-progressbar
Expand Down Expand Up @@ -659,6 +698,7 @@ GEM
term-ansicolor (1.3.2)
tins (~> 1.0)
thor (0.19.1)
thread (0.2.2)
thread_safe (0.3.5)
tilt (2.0.5)
tins (1.12.0)
Expand Down Expand Up @@ -717,6 +757,7 @@ DEPENDENCIES
ezid-client
factory_girl_rails
fcrepo_wrapper (~> 0.6.0)
geo_concerns (~> 0.3.3)
hydra-derivatives (= 3.1.3)
hydra-pcdm!
hydra-role-management (~> 0.2.0)
Expand Down Expand Up @@ -770,4 +811,4 @@ DEPENDENCIES
webmock (~> 1.0)

BUNDLED WITH
1.12.5
1.13.6
6 changes: 6 additions & 0 deletions app/actors/curation_concerns/actors/image_work_actor.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module CurationConcerns
module Actors
class ImageWorkActor < CurationConcerns::Actors::BaseActor
end
end
end
6 changes: 6 additions & 0 deletions app/actors/curation_concerns/actors/raster_work_actor.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module CurationConcerns
module Actors
class RasterWorkActor < CurationConcerns::Actors::BaseActor
end
end
end
6 changes: 6 additions & 0 deletions app/actors/curation_concerns/actors/vector_work_actor.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module CurationConcerns
module Actors
class VectorWorkActor < CurationConcerns::Actors::BaseActor
end
end
end
2 changes: 1 addition & 1 deletion app/actors/file_set_actor.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class FileSetActor < ::CurationConcerns::Actors::FileSetActor
def attach_file_to_work(*args)
super.tap do |_result|
messenger.record_updated(args.first)
messenger.record_updated(args.first) unless args.first.is_a? GeoConcerns::BasicGeoMetadata
end
end

Expand Down
Binary file added app/assets/fonts/work-icons/work-icons.eot
Binary file not shown.
16 changes: 16 additions & 0 deletions app/assets/fonts/work-icons/work-icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/fonts/work-icons/work-icons.ttf
Binary file not shown.
Binary file added app/assets/fonts/work-icons/work-icons.woff
Binary file not shown.
4 changes: 3 additions & 1 deletion app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
//= require bootstrap-select
//= require openseadragon

// = require curation_concerns/application
//= require geo_concerns
//= require curation_concerns/application
//= require_tree .
//= require geo_concerns/es6-modules

//= require modernizr
//= require jquery.iiifOsdViewer
Expand Down
1 change: 1 addition & 0 deletions app/assets/javascripts/geo_concerns.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//= require geo_concerns/application
2 changes: 2 additions & 0 deletions app/assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*= require jquery-ui/datepicker
*= require jquery-ui/slider
*= require jqueryui-timepicker-addon
*= require geo_concerns/application
*= require_self
*/

Expand All @@ -36,6 +37,7 @@

@import 'base/typography';

@import 'components/bounding_box';
@import 'components/breadcrumb';
@import 'components/datepicker';
@import 'components/fileupload';
Expand Down
5 changes: 5 additions & 0 deletions app/assets/stylesheets/components/bounding_box.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.bbox-inputs {
span.input-group-addon {
color: $black;
}
}
45 changes: 44 additions & 1 deletion app/assets/stylesheets/components/font-face.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,47 @@
font-url('Droid_Serif/droidserif-webfont.woff') format('woff'), /* Pretty Modern Browsers */
font-url('Droid_Serif/droidserif-webfont.ttf') format('truetype'), /* Safari, Android, iOS */
font-url('Droid_Serif/droidserif-webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
}
}

@font-face {
font-family: 'work-icons';
src: font-url('work-icons/work-icons.eot');
src: font-url('work-icons/work-icons.eot?#iefix') format('embedded-opentype'),
font-url('work-icons/work-icons.woff') format('woff'),
font-url('work-icons/work-icons.ttf') format('truetype'),
font-url('work-icons/work-icons.svg#work-icons') format('svg');
font-weight: normal;
font-style: normal;
}

[class^="icon-"]:before,
[class*=" icon-"]:before {
font-family: 'work-icons' !important;
font-style: normal !important;
font-weight: normal !important;
font-variant: normal !important;
text-transform: none !important;
speak: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

.icon-collection:before {
content: "\61";
}
.icon-image-work:before {
content: "\62";
}
.icon-multi-volume-work:before {
content: "\63";
}
.icon-raster-work:before {
content: "\64";
}
.icon-scanned-resource:before {
content: "\65";
}
.icon-vector-work:before {
content: "\66";
}
23 changes: 21 additions & 2 deletions app/assets/stylesheets/components/welcome_page.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
.row > .classify-work {
.classify-work {
padding-left: 0px;
& > .work-type {
min-height: 190px;
float: left;
display: block;
}
& > .work-type-Collection {
& > .work-type {
.short-description {
height: 6.1em;
}
.work-icon {
font-size: 50px;
color: $blue;
padding: 15px 0 15px 0;
}
}
.title {
margin-top: 5px;
}
}

.panel-classify-work {
@include panel-variant(none, $gray-light, $light-gray, $panel-default-border);
-webkit-box-shadow: none;
box-shadow: none;
& > .panel-heading {
border-style: solid;
border-width: 1px;
}
}
3 changes: 3 additions & 0 deletions app/assets/stylesheets/geo_concerns.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/*
*= require geo_concerns/application
*/
6 changes: 3 additions & 3 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def self.search_config
config.index.title_field = solr_name('title', :stored_searchable)
config.index.display_type_field = solr_name('has_model', :symbol)

# config.index.thumbnail_field = 'thumbnail_path_ss'
config.index.thumbnail_method = :iiif_thumbnail_path
config.index.thumbnail_field = 'thumbnail_path_ss'
config.index.thumbnail_method = :plum_thumbnail_path
# config.index.partials.delete(:thumbnail) # we render this inside _index_default.html.erb
config.index.partials += [:action_menu]

Expand Down Expand Up @@ -51,7 +51,7 @@ def self.search_config
# The ordering of the field names is the order of the display
config.add_index_field solr_name('description', :stored_searchable)
config.add_index_field solr_name('tag', :stored_searchable)
config.add_index_field solr_name('subject', :stored_searchable)
config.add_index_field solr_name('subject', :stored_searchable), helper_method: :index_subject
config.add_index_field solr_name('creator', :stored_searchable)
config.add_index_field solr_name('contributor', :stored_searchable)
config.add_index_field solr_name('publisher', :stored_searchable)
Expand Down
24 changes: 24 additions & 0 deletions app/controllers/concerns/curation_concerns/flagging.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module CurationConcerns
module Flagging
extend ActiveSupport::Concern

included do
def flag
curation_concern.state = 'flagged'
note = params[curation_concern.class.name.underscore][:workflow_note]
curation_concern.workflow_note = curation_concern.workflow_note + [note] unless note.blank?
if curation_concern.save
respond_to do |format|
format.html { redirect_to [main_app, curation_concern], notice: "Resource updated" }
format.json { render json: { state: state } }
end
else
respond_to do |format|
format.html { redirect_to [main_app, curation_concern], alert: "Unable to update resource" }
format.json { render json: { error: "Unable to update resource" } }
end
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module CurationConcerns
module GeoMessengerBehavior
extend ActiveSupport::Concern

def destroy
geo_concerns_messenger.record_deleted(geo_concern)
super
end

def after_update_response
super
return unless geo_concern.state == 'complete'
geo_concerns_messenger.record_updated(geo_concern)
end

def geo_concerns_messenger
@geo_concerns_messenger ||= GeoConcerns::Messaging.messenger
end

def geo_concern
doc = SolrDocument.new(curation_concern.to_solr)
show_presenter.new(doc, current_ability, request)
end
end
end
Loading

0 comments on commit 90a1315

Please sign in to comment.