DSpace / xoai

OAI-PMH Java Toolkit
29 stars 52 forks source link

Handle cases when unknown metadataPrefix is received #54

Closed cgendreau closed 7 years ago

cgendreau commented 9 years ago

Handling of cases when ListIdentifiers or ListRecords request includes an unknown metadata prefix.

mmalmeida commented 7 years ago

Hi @cgendreau. I've recently been allocated to XOAI and I am currently reviewing the Pull requests.

While everything seems to be working in your change, the copy-paste of the same code in two classes violates the DRY principle.

Would you be able to refactor your commit as to not repeat the same code?

Thank you for your contribution!

cgendreau commented 7 years ago

Are you refering to ListIdentifiersHandler.java and ListRecordsHandler.java or the test?

mmalmeida commented 7 years ago

I was referring to the Handlers (although you are right that the same thing could apply to the tests ;) )

mmalmeida commented 7 years ago

@cgendreau would you be able to provide the requested changes in time for the next release? Thanks!

cgendreau commented 7 years ago

yes, but I must admit I'm not sure what you expect. This is a 3 lines (that could be a single line) precondition check that is not a good fit for VerbHandler or ItemRepositoryHelper. Maybe a new PreconditionHelper under the handlers package?

mmalmeida commented 7 years ago

I agree. Handlers already has a helpers package, seems like a good place to put it. Thanks!