Class: GeoserverDeliveryJob
- Inherits:
-
ActiveJob::Base
- Object
- ActiveJob::Base
- GeoserverDeliveryJob
- Defined in:
- app/jobs/geoserver_delivery_job.rb
Overview
Delivers derivatives to external services, like GeoServer
Instance Attribute Summary collapse
-
#file_set ⇒ Object
readonly
Returns the value of attribute file_set.
Instance Method Summary collapse
- #content_url ⇒ Object
- #derivatives_service ⇒ Object
-
#perform(message) ⇒ Object
Precondition is that all derivatives are created and saved.
Instance Attribute Details
#file_set ⇒ Object (readonly)
Returns the value of attribute file_set.
9 10 11 |
# File 'app/jobs/geoserver_delivery_job.rb', line 9 def file_set @file_set end |
Instance Method Details
#content_url ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'app/jobs/geoserver_delivery_job.rb', line 22 def content_url case file_set.geo_mime_type when *GeoWorks::RasterFormatService..map(&:last) return derivatives_service.send(:derivative_url, 'display_raster') when *GeoWorks::VectorFormatService..map(&:last) return derivatives_service.send(:derivative_url, 'display_vector') else return '' end end |
#derivatives_service ⇒ Object
33 34 35 |
# File 'app/jobs/geoserver_delivery_job.rb', line 33 def derivatives_service GeoWorks::FileSetDerivativesService.new(file_set) end |
#perform(message) ⇒ Object
Precondition is that all derivatives are created and saved.
15 16 17 18 19 20 |
# File 'app/jobs/geoserver_delivery_job.rb', line 15 def perform() @file_set = ActiveFedora::Base.find(['id']) uri = URI.parse(content_url) return if uri.path == '' GeoWorks::DeliveryService.new(file_set, uri.path).publish end |