kwin commented on code in PR #2223:
URL: https://github.com/apache/jackrabbit-oak/pull/2223#discussion_r2078233425


##########
oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/xml/SysViewImportHandler.java:
##########
@@ -93,6 +95,39 @@ private void processNode(ImportState state, boolean start, 
boolean end)
         }
     }
 
+    //TODO replace with library method
+    private static @NotNull String suggestPrefix(String namespace) {
+        return "ns_" + UUID.randomUUID().toString().substring(0, 8);
+    }
+
+    private NameInfo createNameInfo(String svName) throws RepositoryException {

Review Comment:
   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.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: oak-dev-unsubscr...@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to