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

parser/serializer for files.xml #15

Open
rvanheest opened this issue Jul 18, 2018 · 3 comments
Open

parser/serializer for files.xml #15

rvanheest opened this issue Jul 18, 2018 · 3 comments
Assignees
Milestone

Comments

@rvanheest
Copy link
Contributor

Write a parser and serializer for files.xml <-> FilesXml.
Don't expose them via the FilesXml (maybe put them in an internal package, such that they're still accessible if needed), but use them in functions like read (parse xml to object) and save (serialize object to xml).
Make sure that files.xml -> FilesXml -> files.xml results in the same xml as with which you started.

@jo-pol
Copy link
Contributor

jo-pol commented Jul 30, 2018

Does this imply a refactoring of FilesXml in the deposit-api? It currently serializes files in a folder to a scala.xml.Elem written to files.xml by DepositDir.createXMLs.

@rvanheest
Copy link
Contributor Author

@jo-pol probably after this milestone has been completed, your FilesXml has to be rewritten indeed. As described in #16, files will automatically be added to files.xml when they're added to the bag (and when .save() is called!).

Before .save() is called, they are only stored in the object model for FilesXml and on .save() they're being serialized into XML. On .read() they are parsed again from files.xml to the FilesXml object model.

@rvanheest
Copy link
Contributor Author

Points for discussion:

  • does the parser (files.xml -> FilesXml) have to return an error if files.xml is invalid according to the schema?
  • when reading the files.xml in the context of a bag (so, not using FilesXml.read() directly, but via DansBag.read()), should the bag also validate all its payload files against the files listed in files.xml?
    • Note: we don't do this yet with manifest-sha1.txt, fetch.txt or tagmanifest-sha1.txt!

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