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

Add implementation of: https://ocfl.github.io/extensions/0006-flat-om… #43

Merged
merged 3 commits into from
Jul 26, 2021

Conversation

awoods
Copy link
Member

@awoods awoods commented Jul 19, 2021

…it-prefix-storage-layout.html

Copy link
Collaborator

@pwinckles pwinckles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I left a few implementation notes. Additionally, there are a couple other places in the code that need updated:

  1. It should be added to this map
  2. It should be added to the list of implemented storage layout extensions in the README

@pwinckles
Copy link
Collaborator

@awoods
Copy link
Member Author

awoods commented Jul 22, 2021

Thanks for the review!

Copy link
Collaborator

@pwinckles pwinckles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I believe it's just missing the registry entry.

public static final String EXTENSION_NAME = "0006-flat-omit-prefix-storage-layout";

private FlatOmitPrefixLayoutConfig config;
private boolean isCaseSensitive = true; // The spec does not provide for configuring this
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

During the init call you could do something like:

isCaseSensitive = !delimiter.toLowerCase().equals(delimiter.toUpperCase());

Then, if it's not case sensitive, there's no need to lower case the object id on mapObjectId.

If you don't care about this optimization, then we probably don't need the isCaseSensitive field.

String delim = config.getDelimiter();
String id = objectId;
if (isCaseSensitive) {
delim = delim.toLowerCase();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you stick with isCaseSensitive, then you may was well compute this lower case delimiter value once on init.

@pwinckles
Copy link
Collaborator

Looks good. Will merge when I'm back from vacation on Monday

Copy link
Collaborator

@pwinckles pwinckles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@pwinckles pwinckles merged commit eb651a7 into OCFL:main Jul 26, 2021
@awoods awoods deleted the omit-prefix-extension branch July 26, 2021 12:51
@awoods
Copy link
Member Author

awoods commented Jul 26, 2021

@pwinckles : I will keep my eye our for a release in order to remove the extension logic from our codebase. Thanks!

@pwinckles
Copy link
Collaborator

@pwinckles : I will keep my eye our for a release in order to remove the extension logic from our codebase. Thanks!

Just released it, but it may take a little bit to show up in central.

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

Successfully merging this pull request may close these issues.

2 participants