jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bertrand Delacretaz (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-2687) [PATCH] DeepNodeCreator utility
Date Mon, 02 Aug 2010 13:03:17 GMT

    [ https://issues.apache.org/jira/browse/JCR-2687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12894548#action_12894548

Bertrand Delacretaz commented on JCR-2687:

The reason for creating a different class in my patch is this method:

protected String getNodeType(Node parent, String childPath, String suggestedNodeType) 
throws RepositoryException {
  return suggestedNodeType;

Which can be overridden to provide various node types for ancestors of the node to create.

To integrate this in JcrUtils as is, I'd need to define an interface there, something like

public class JcrUtils {
  public static interface NodeTypeProvider {
    ..getNodeType method as above...

Pass a NodeTypeProvider to the deepCreateNode method, and if null use a default implementation.

Would that fit with the overall design? 

If yes I'm fine with moving that there.

> [PATCH] DeepNodeCreator utility
> -------------------------------
>                 Key: JCR-2687
>                 URL: https://issues.apache.org/jira/browse/JCR-2687
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.1.0
>            Reporter: Bertrand Delacretaz
>            Priority: Minor
>         Attachments: JCR-2687.patch
> The attached patch supplies a DeepNodeCreator utility, to create nodes and their parents
> I've seen lots of such utilities flying around, it might be good to have a basic one
as standard.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message