Skip to content

Commit

Permalink
lookup now in crosswalk_admin_sets
Browse files Browse the repository at this point in the history
  • Loading branch information
lsat12357 committed Jun 7, 2022
1 parent 8b54d40 commit 5789ee7
Show file tree
Hide file tree
Showing 5 changed files with 266 additions and 90 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def set_configs
@skip_field_mode = @config.skip_field_mode
@crosswalk_metadata_file = @config.crosswalk_metadata_file
@crosswalk_overrides_file = @config.crosswalk_overrides_file
@full_size_map_file = @config.full_size_map_file
@crosswalk_admin_sets_file = @config.crosswalk_admin_sets_file
end

# returns result hash
Expand Down Expand Up @@ -77,15 +77,15 @@ def log_info(object)
def full_size_hack(object)
return nil if @result[:full_size_download_allowed] == false

record = full_size_map.select { |coll| coll[:id] == object.to_s }.first
record = admin_set_map.select { |coll| coll[:primary_set] == object.to_s }.first
data = lookup('http://opaquenamespace.org/ns/fullSizeDownloadAllowed')
assemble_hash(data, record[:perm]) unless record.blank?
assemble_hash(data, record[:full_size_download]) unless record.blank?
nil
end

def full_size_map
yaml = YAML.load_file(@full_size_map_file).deep_symbolize_keys
yaml[:full_size]
def admin_set_map
yaml = YAML.load_file(@crosswalk_admin_sets_file).deep_symbolize_keys
yaml[:primary_set_crosswalk]
end

def mark_destroy(cv_val)
Expand Down
5 changes: 0 additions & 5 deletions lib/hyrax/migrator/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,5 @@ def required_fields_file
def verify_services
@verify_services ||= ENV['VERIFY_SERVICES']
end

attr_writer :full_size_map_file
def full_size_map_file
@full_size_map_file ||= ''
end
end
end

0 comments on commit 5789ee7

Please sign in to comment.