Skip to content
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

Retrieving previous versions of a datastream's content #10

Open
bcail opened this issue Jan 28, 2015 · 2 comments
Open

Retrieving previous versions of a datastream's content #10

bcail opened this issue Jan 28, 2015 · 2 comments

Comments

@bcail
Copy link
Contributor

bcail commented Jan 28, 2015

I have an XML datastream that's been modified, and I want to retrieve previous versions of the datastream content.

Here's what I currently have:
obj.api.getDatastreamDissemination(obj.pid, 'MODS', asOfDateTime=obj.mods.history().versions[0].created).text
That gives me the text of the datastream for whichever version I want - but am I missing an easier way?

Something like this would be nice:
obj.mods.history().versions[0].content
That way I wouldn't need to know how to call getDatastreamDissemination. Also, 'content' could return the actual XmlDatastreamObject, like obj.mods.content does.

@rlskoeser
Copy link
Contributor

I guess we never needed access to older versions of datastreams frequently enough to create something like this. You're right that there currently is not an easier way to access this content. Your proposal sounds like a nice idea, though.

I think instead of parking the content under history().versions[0] it would make more sense to provide access from the top level of the datastream object. Possibly something like:

obj.mods.versions[0].content 

And then datastream properties like checksum, creation date, etc would be accessible at

obj.mods.versions[0].created

@rlskoeser
Copy link
Contributor

Forgot to say, I don't expect to have time to work on this anytime soon, but we would certainly welcome a pull request with code, documentation, and tests, and I'd be willing to help talk through implementation details if that is useful.

Otherwise, I'll try to keep it in mind for whenever I do have time to work on enhancing eulfedora.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants