Skip to content

OAK-9586: SysViewImportHandler does not support expanded names in sv:name attributes #2223

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

Draft
wants to merge 4 commits into
base: trunk
Choose a base branch
from

Conversation

mbaedke
Copy link
Contributor

@mbaedke mbaedke commented Apr 10, 2025

Prefix generation is preliminary.

…name attributes

Prelimary fix, needs beautification.
@mbaedke mbaedke marked this pull request as draft April 10, 2025 14:50
Copy link

Commit-Check ✔️

@mbaedke mbaedke requested review from reschke and kwin April 10, 2025 14:51
} catch (NamespaceException expected) {
// this is an expanded svName using an unregistered namespace
// we need to make up a prefix for the namespace
prefix = "ns_" + UUID.randomUUID().toString().substring(0, 8);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's temporary. We already have other places where we create ns prefixes, I'm going to clone from there.

@mbaedke mbaedke marked this pull request as ready for review April 28, 2025 12:21
@mbaedke mbaedke marked this pull request as draft April 28, 2025 12:57
Copy link

return "ns_" + UUID.randomUUID().toString().substring(0, 8);
}

private NameInfo createNameInfo(String svName) throws RepositoryException {
Copy link
Member

Choose a reason for hiding this comment

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

I think this whole logic should be common across all JCR methods potentially creating new items (with potentially unregistered expanded names) such as

  • Node.addNode(...)
  • Node.setProperty(...)
  • Session.move(...)

Probably one needs to add a SessionContext.getOrCreateOakPath(...) similar to the getOakPath(...) which is called from all those methods. The implementation should delegate to a new method PathMapper.getOrCreateOakPath(...) which should automatically register all unknown prefixes.

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