-
Notifications
You must be signed in to change notification settings - Fork 7
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
Question: how do I add a new version of a content file to an existing object? #5
Comments
I guess I'm looking for the functionality that's in Birkland's ocfl client:
|
I haven't imagined the case of adding a single file use in what is written so far. I have only considered adding whole versions to an object (which is then managed with |
@zimeon would you be open to a PR that lets you add just one file (or multiple files) to an object, without constructing a full version directory? |
I'd like to be able to do something like this:
So all I have to know is the file that I'm adding, and the object id. Would that make sense to add? |
I don't think I would want to add facilities to update an already written version because that doesn't follow the archival model of OCFL. I think it would be interesting to have a facility that added/removed/updated files starting from the current version, while creating a new version |
sorry, yes, that's what I mean - create a new version (but having all the versioning, existing files, ... hidden where the user doesn't have to know about it) |
ocfl-java has the idea of updating an object with a series of actions that result in a new version in the object: So the user can add files, remove files, ... and a new version gets created with the results of those actions. Should we do something similar here in this package? We could have actions that can be taken on an Object, and then a commit method, or a new object updater class that handles the actions and gets passed to an update_object method like ocfl-java does, ... Any thoughts on the approach you'd like to see? |
Yes, I think a file-by-file updater to create a new version would be good. If we were cute it could be a context manager so one could do something like:
where successful completion writes the new version and updates the inventory etc., an exception tidies up the incomplete new version creation |
If I have an existing object, and now I want to add a new version of a content file, what method do I call? Seems like Object.add_version expects a fully-created ocfl version directory, but I just want to add a new content file, without building a new ocfl version. Or do I have to create a new ocfl version first, and then add it to the object?
Thanks.
The text was updated successfully, but these errors were encountered: