-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't support source & output files that are directly contained by the Fedora object #60
Comments
@flyingzumwalt seems like the solution should be that hydra-derivatives accepts parameters for these. Is the gem currently making too many assumptions about the model? |
@awead one solution would be to use Exampledef source_file
object.send(source_name.to_sym)
end instead of def source_file
object.attached_files[source_name.to_s]
end |
or maybe rely on a retrieve_attached_file method def retrieve_attached_file(object, attachment_ref)
object.send(attachment_ref.to_sym)
end
def source_file
retrieve_attached_file(object, source_name)
end
def output_file(path)
# first, check for a defined file
output_file = if retrieve_attached_file(object, path)
object.attached_files[path]
else
ActiveFedora::File.new("#{object.uri}/#{path}").tap do |file|
object.attach_file(file, path)
end
end
end |
I would love it if hydra-derivatives didn't assume that you were using fedora at all. Let the |
Then hydra-derivatives would become the first hydra gem that's truly useful outside of the hydra/fedora sphere. |
👍 to that. |
@flyingzumwalt specify a default class Hydra::Derivatives::Processor::Base
def retrieve_attached_file
raise NotImplementedError, "You must specify a method for retrieving the file's content"
end
end |
That doesn't work. That would mean all of your Processors have to choose |
fair enough! |
👍 to this work, hydra-derivatives assumptions about the model keep us from adopting it. |
Solving this by refactoring Processors to use a RetrieveSourceFile service for retrieving source file and a PersistOutputFile service for persisting output file. These services can be configured in the initializer and/or in your calls to transform_file. |
This is shown in PR #59
The text was updated successfully, but these errors were encountered: