You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Jukka Zitting (JIRA)" <ji...@apache.org> on 2009/09/09 14:07:57 UTC

[jira] Created: (JCR-2301) CND support in jackrabbit-jcr-commons

CND support in jackrabbit-jcr-commons
-------------------------------------

                 Key: JCR-2301
                 URL: https://issues.apache.org/jira/browse/JCR-2301
             Project: Jackrabbit Content Repository
          Issue Type: New Feature
          Components: jackrabbit-jcr-commons, nodetype
            Reporter: Jukka Zitting


It would be nice if the CND parsing functionality in spi-commons could be made available in jcr-commons for use by JCR clients that shouldn't have to know anything about the SPI.

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


[jira] Commented: (JCR-2301) CND support in jackrabbit-jcr-commons

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12753077#action_12753077 ] 

Michael Dürig commented on JCR-2301:
------------------------------------

The process needs to be a bit more general. We need the parser to be able to generate QNodeTypeDefinitions (SPI usage) and NodeTypeDefinitions (JCR usage). So I suggest to split the parser into a front end for lexical/syntactical analysis and a back end for generating the specific representation. AFAIR the split is more or less there already (see usage of QNodeDefinitionBuilder, QNodeTypeDefinitionBuilder, QPropertyDefinitionBuilder). Only the back ends would have to be factored out. 

> CND support in jackrabbit-jcr-commons
> -------------------------------------
>
>                 Key: JCR-2301
>                 URL: https://issues.apache.org/jira/browse/JCR-2301
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons, nodetype
>            Reporter: Jukka Zitting
>
> It would be nice if the CND parsing functionality in spi-commons could be made available in jcr-commons for use by JCR clients that shouldn't have to know anything about the SPI.

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


[jira] Resolved: (JCR-2301) CND support in jackrabbit-jcr-commons

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Dürig resolved JCR-2301.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.0

Fixed in revision: 814610  

In addition to the changes in the patch, I added the CndImporter utility class which can be used for importing CNDs. 

> CND support in jackrabbit-jcr-commons
> -------------------------------------
>
>                 Key: JCR-2301
>                 URL: https://issues.apache.org/jira/browse/JCR-2301
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons, jackrabbit-spi-commons, nodetype
>            Reporter: Jukka Zitting
>            Assignee: Michael Dürig
>             Fix For: 2.0.0
>
>         Attachments: JCR-2301-poc.patch, JCR-2301.patch
>
>
> It would be nice if the CND parsing functionality in spi-commons could be made available in jcr-commons for use by JCR clients that shouldn't have to know anything about the SPI.

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


[jira] Commented: (JCR-2301) CND support in jackrabbit-jcr-commons

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12753543#action_12753543 ] 

Jukka Zitting commented on JCR-2301:
------------------------------------

Sure, but why do we need the builder layer instead of directly using the JCR 2.0 API?

> CND support in jackrabbit-jcr-commons
> -------------------------------------
>
>                 Key: JCR-2301
>                 URL: https://issues.apache.org/jira/browse/JCR-2301
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons, nodetype
>            Reporter: Jukka Zitting
>         Attachments: JCR-2301-poc.patch
>
>
> It would be nice if the CND parsing functionality in spi-commons could be made available in jcr-commons for use by JCR clients that shouldn't have to know anything about the SPI.

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


[jira] Commented: (JCR-2301) CND support in jackrabbit-jcr-commons

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12753059#action_12753059 ] 

Michael Dürig commented on JCR-2301:
------------------------------------

Initially the CND parser moved from core to spi-commons. See JCR-1516. 

The parser is useful for both JCR and SPI. So there will always be an additional dependency. Since SPI implementations almost always depend on jcr-commons anyway, moving the parser might be a good idea. 

However, the different representations of Names, Types etc would have to be factored out. Currently the parser uses builders for constructing the types (QNodeDefinitionBuilder, QNodeTypeDefinitionBuilder, QPropertyDefinitionBuilder). These would need to be generalized. Both jcr-commons and spi-commons need to provide their specific versions for these builders. 

> CND support in jackrabbit-jcr-commons
> -------------------------------------
>
>                 Key: JCR-2301
>                 URL: https://issues.apache.org/jira/browse/JCR-2301
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons, nodetype
>            Reporter: Jukka Zitting
>
> It would be nice if the CND parsing functionality in spi-commons could be made available in jcr-commons for use by JCR clients that shouldn't have to know anything about the SPI.

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


[jira] Commented: (JCR-2301) CND support in jackrabbit-jcr-commons

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12754039#action_12754039 ] 

Marcel Reutegger commented on JCR-2301:
---------------------------------------

I like this approach.

> CND support in jackrabbit-jcr-commons
> -------------------------------------
>
>                 Key: JCR-2301
>                 URL: https://issues.apache.org/jira/browse/JCR-2301
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons, nodetype
>            Reporter: Jukka Zitting
>         Attachments: JCR-2301-poc.patch, JCR-2301.patch
>
>
> It would be nice if the CND parsing functionality in spi-commons could be made available in jcr-commons for use by JCR clients that shouldn't have to know anything about the SPI.

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


[jira] Commented: (JCR-2301) CND support in jackrabbit-jcr-commons

Posted by "Alexander Klimetschek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12753096#action_12753096 ] 

Alexander Klimetschek commented on JCR-2301:
--------------------------------------------

> 14 commits ... in 2009 only doesn't seem too stable to me

All those commits were related to JCR 2.0 changes or general clean up, not fixing actual parsing bugs. I think moving all those QNode* classes over to jcr-commons is really a bit of overkill, if you can get them simply via NodeTypeManager.createNodeTypeTemplate() et al.

Otherwise I think one could share the lexer and an abstract base class for CND reading that operates on JCR 2.0 NodeTypeTemplate interfaces (and gets them from an abstract method createNodeTypeTemplate(), same for node defs and property defs). If this will be used by spi-commons as well, it would be forced to have QNode* to extend from the new JCR 2.0 templates. Or one would provide yet another wrapper that implements both *Template and QNode* interfaces, internal to the spi cnd parser.

> CND support in jackrabbit-jcr-commons
> -------------------------------------
>
>                 Key: JCR-2301
>                 URL: https://issues.apache.org/jira/browse/JCR-2301
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons, nodetype
>            Reporter: Jukka Zitting
>
> It would be nice if the CND parsing functionality in spi-commons could be made available in jcr-commons for use by JCR clients that shouldn't have to know anything about the SPI.

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


[jira] Commented: (JCR-2301) CND support in jackrabbit-jcr-commons

Posted by "Alexander Klimetschek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12753584#action_12753584 ] 

Alexander Klimetschek commented on JCR-2301:
--------------------------------------------

I would also prefer usage of the JCR 2.0 API *Template interfaces. SPI could be rewritten to have the Q* interfaces extend from them. A subclass of the cnd parser in jcr-commons in spi-commons could then set the parsed variants of names and namespace mappings on the Q* objects.

> CND support in jackrabbit-jcr-commons
> -------------------------------------
>
>                 Key: JCR-2301
>                 URL: https://issues.apache.org/jira/browse/JCR-2301
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons, nodetype
>            Reporter: Jukka Zitting
>         Attachments: JCR-2301-poc.patch
>
>
> It would be nice if the CND parsing functionality in spi-commons could be made available in jcr-commons for use by JCR clients that shouldn't have to know anything about the SPI.

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


[jira] Commented: (JCR-2301) CND support in jackrabbit-jcr-commons

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12753071#action_12753071 ] 

Jukka Zitting commented on JCR-2301:
------------------------------------

IMHO a version in jcr-commons should *not* implement the Definition and Template classes. Instead it should use the standard JCR factory methods to build the type templates based on the parsed CND files.

> CND support in jackrabbit-jcr-commons
> -------------------------------------
>
>                 Key: JCR-2301
>                 URL: https://issues.apache.org/jira/browse/JCR-2301
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons, nodetype
>            Reporter: Jukka Zitting
>
> It would be nice if the CND parsing functionality in spi-commons could be made available in jcr-commons for use by JCR clients that shouldn't have to know anything about the SPI.

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


[jira] Commented: (JCR-2301) CND support in jackrabbit-jcr-commons

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12753090#action_12753090 ] 

Michael Dürig commented on JCR-2301:
------------------------------------

14 commits to jackrabbit-spi-commons\src\main\java\org\apache\jackrabbit\spi\commons\nodetype\compact in 2009 only doesn't seem too stable to me ;-)

I dont like the idea of duplicate code here. I'd still go with factoring out the differences. 

> CND support in jackrabbit-jcr-commons
> -------------------------------------
>
>                 Key: JCR-2301
>                 URL: https://issues.apache.org/jira/browse/JCR-2301
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons, nodetype
>            Reporter: Jukka Zitting
>
> It would be nice if the CND parsing functionality in spi-commons could be made available in jcr-commons for use by JCR clients that shouldn't have to know anything about the SPI.

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


[jira] Commented: (JCR-2301) CND support in jackrabbit-jcr-commons

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12753546#action_12753546 ] 

Tobias Bocanegra commented on JCR-2301:
---------------------------------------

..because you would loose the namespaces if pure NodeTypeDefinitions would be builded. but if the provided namespaces are exposed from the reader, thats probably ok.

> CND support in jackrabbit-jcr-commons
> -------------------------------------
>
>                 Key: JCR-2301
>                 URL: https://issues.apache.org/jira/browse/JCR-2301
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons, nodetype
>            Reporter: Jukka Zitting
>         Attachments: JCR-2301-poc.patch
>
>
> It would be nice if the CND parsing functionality in spi-commons could be made available in jcr-commons for use by JCR clients that shouldn't have to know anything about the SPI.

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


[jira] Assigned: (JCR-2301) CND support in jackrabbit-jcr-commons

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Dürig reassigned JCR-2301:
----------------------------------

    Assignee: Michael Dürig

> CND support in jackrabbit-jcr-commons
> -------------------------------------
>
>                 Key: JCR-2301
>                 URL: https://issues.apache.org/jira/browse/JCR-2301
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons, jackrabbit-spi-commons, nodetype
>            Reporter: Jukka Zitting
>            Assignee: Michael Dürig
>         Attachments: JCR-2301-poc.patch, JCR-2301.patch
>
>
> It would be nice if the CND parsing functionality in spi-commons could be made available in jcr-commons for use by JCR clients that shouldn't have to know anything about the SPI.

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


[jira] Commented: (JCR-2301) CND support in jackrabbit-jcr-commons

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12753073#action_12753073 ] 

Michael Dürig commented on JCR-2301:
------------------------------------

> Any problem that I missed? 
Yes, SPI implementations need to read cnd files and create QNode... representations from them. 

> CND support in jackrabbit-jcr-commons
> -------------------------------------
>
>                 Key: JCR-2301
>                 URL: https://issues.apache.org/jira/browse/JCR-2301
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons, nodetype
>            Reporter: Jukka Zitting
>
> It would be nice if the CND parsing functionality in spi-commons could be made available in jcr-commons for use by JCR clients that shouldn't have to know anything about the SPI.

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


[jira] Commented: (JCR-2301) CND support in jackrabbit-jcr-commons

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12753539#action_12753539 ] 

Michael Dürig commented on JCR-2301:
------------------------------------

With my patch it isn't anymore. Creating the type representations is delegated to a builder. 

> CND support in jackrabbit-jcr-commons
> -------------------------------------
>
>                 Key: JCR-2301
>                 URL: https://issues.apache.org/jira/browse/JCR-2301
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons, nodetype
>            Reporter: Jukka Zitting
>         Attachments: JCR-2301-poc.patch
>
>
> It would be nice if the CND parsing functionality in spi-commons could be made available in jcr-commons for use by JCR clients that shouldn't have to know anything about the SPI.

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


[jira] Commented: (JCR-2301) CND support in jackrabbit-jcr-commons

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12754079#action_12754079 ] 

Michael Dürig commented on JCR-2301:
------------------------------------

> - can we move the Q*DefinitionsBuilder one package up?
Ok ack. I'll do so.

> CND support in jackrabbit-jcr-commons
> -------------------------------------
>
>                 Key: JCR-2301
>                 URL: https://issues.apache.org/jira/browse/JCR-2301
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons, nodetype
>            Reporter: Jukka Zitting
>         Attachments: JCR-2301-poc.patch, JCR-2301.patch
>
>
> It would be nice if the CND parsing functionality in spi-commons could be made available in jcr-commons for use by JCR clients that shouldn't have to know anything about the SPI.

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


[jira] Commented: (JCR-2301) CND support in jackrabbit-jcr-commons

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12753106#action_12753106 ] 

Michael Dürig commented on JCR-2301:
------------------------------------

Instead of using inheritance for parametrization of the parser I'd use composition as explained above:

The parser already uses a builder (QNodeTypeDefinitionsBuilder) to build the final representation. That is, the parser itself is rather independent of the spi classes. The builder is not. I suggest to change things along the line of

class CompactNodeTypeDefReader {...} 
to 
class CompactNodeTypeDefReader<T> {...}

The constructor which now takes a QNodeTypeDefinitionsBuilder would then take a NodeTypeDefinitionsBuilder<T> and getNodeTypeDefinitions() would return List<T>. 

Like this jcr-commons and spi-commons both need to provide a builder which can be used with the parser. The parser itself can be reused amongst both modules. 


> CND support in jackrabbit-jcr-commons
> -------------------------------------
>
>                 Key: JCR-2301
>                 URL: https://issues.apache.org/jira/browse/JCR-2301
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons, nodetype
>            Reporter: Jukka Zitting
>
> It would be nice if the CND parsing functionality in spi-commons could be made available in jcr-commons for use by JCR clients that shouldn't have to know anything about the SPI.

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


[jira] Updated: (JCR-2301) CND support in jackrabbit-jcr-commons

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Dürig updated JCR-2301:
-------------------------------

    Component/s: jackrabbit-spi-commons

> CND support in jackrabbit-jcr-commons
> -------------------------------------
>
>                 Key: JCR-2301
>                 URL: https://issues.apache.org/jira/browse/JCR-2301
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons, jackrabbit-spi-commons, nodetype
>            Reporter: Jukka Zitting
>            Assignee: Michael Dürig
>         Attachments: JCR-2301-poc.patch, JCR-2301.patch
>
>
> It would be nice if the CND parsing functionality in spi-commons could be made available in jcr-commons for use by JCR clients that shouldn't have to know anything about the SPI.

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


[jira] Updated: (JCR-2301) CND support in jackrabbit-jcr-commons

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Dürig updated JCR-2301:
-------------------------------

    Attachment: JCR-2301.patch

JCR-2301.patch contains the same changes like the previous patch and in addition moves the parser to jcr-commons. In addition it adds ItemTemplatesBuilder which can be used with CompactNodeTypeDefReader to build NodeTypeTemplate instances from a CND. 



> CND support in jackrabbit-jcr-commons
> -------------------------------------
>
>                 Key: JCR-2301
>                 URL: https://issues.apache.org/jira/browse/JCR-2301
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons, nodetype
>            Reporter: Jukka Zitting
>         Attachments: JCR-2301-poc.patch, JCR-2301.patch
>
>
> It would be nice if the CND parsing functionality in spi-commons could be made available in jcr-commons for use by JCR clients that shouldn't have to know anything about the SPI.

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


[jira] Commented: (JCR-2301) CND support in jackrabbit-jcr-commons

Posted by "Alexander Klimetschek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12754083#action_12754083 ] 

Alexander Klimetschek commented on JCR-2301:
--------------------------------------------

> Note however that you will still have to either pass a Session or a Worspace or a NodeTypeManager, a ValueFactory, and possibly a NamespaceRegistry to such a utility class.

Session should be fine.

> CND support in jackrabbit-jcr-commons
> -------------------------------------
>
>                 Key: JCR-2301
>                 URL: https://issues.apache.org/jira/browse/JCR-2301
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons, nodetype
>            Reporter: Jukka Zitting
>         Attachments: JCR-2301-poc.patch, JCR-2301.patch
>
>
> It would be nice if the CND parsing functionality in spi-commons could be made available in jcr-commons for use by JCR clients that shouldn't have to know anything about the SPI.

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


[jira] Commented: (JCR-2301) CND support in jackrabbit-jcr-commons

Posted by "Alexander Klimetschek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12754049#action_12754049 ] 

Alexander Klimetschek commented on JCR-2301:
--------------------------------------------

I would not object against this approach - the only thing I'd like to see is a simple CND reader (subclass) that works out of the box for JCR 2.0 *Templates without having to worry about any Builder classes. The reason is that we need a plain simple replacement for the deprecated register node types via InputStream of the Jackrabbit API.

> CND support in jackrabbit-jcr-commons
> -------------------------------------
>
>                 Key: JCR-2301
>                 URL: https://issues.apache.org/jira/browse/JCR-2301
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons, nodetype
>            Reporter: Jukka Zitting
>         Attachments: JCR-2301-poc.patch, JCR-2301.patch
>
>
> It would be nice if the CND parsing functionality in spi-commons could be made available in jcr-commons for use by JCR clients that shouldn't have to know anything about the SPI.

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


[jira] Commented: (JCR-2301) CND support in jackrabbit-jcr-commons

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12754075#action_12754075 ] 

Michael Dürig commented on JCR-2301:
------------------------------------

Ok, I'll add such an utility class then and commit the patch (next week). 

Note however that you will still have to either pass a Session or a Worspace or a NodeTypeManager, a ValueFactory, and possibly a NamespaceRegistry to such a utility class. 

> CND support in jackrabbit-jcr-commons
> -------------------------------------
>
>                 Key: JCR-2301
>                 URL: https://issues.apache.org/jira/browse/JCR-2301
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons, nodetype
>            Reporter: Jukka Zitting
>         Attachments: JCR-2301-poc.patch, JCR-2301.patch
>
>
> It would be nice if the CND parsing functionality in spi-commons could be made available in jcr-commons for use by JCR clients that shouldn't have to know anything about the SPI.

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


[jira] Commented: (JCR-2301) CND support in jackrabbit-jcr-commons

Posted by "Alexander Klimetschek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12753068#action_12753068 ] 

Alexander Klimetschek commented on JCR-2301:
--------------------------------------------

I can imagine a (copied/new) cnd parser that does not use the QNodeType/Node/PropertyDefinition classes at all. It would directly implement the JCR 2.0 NodeTypeDefinition + NodeTypeTemplate et al. classes and instantiate them. For parsing valid names, it could directly use the session's getNamespaceUri and getNamespacePrefix methods, without using spi's flexible NameResolver mechanism.

Any problem that I missed?

> CND support in jackrabbit-jcr-commons
> -------------------------------------
>
>                 Key: JCR-2301
>                 URL: https://issues.apache.org/jira/browse/JCR-2301
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons, nodetype
>            Reporter: Jukka Zitting
>
> It would be nice if the CND parsing functionality in spi-commons could be made available in jcr-commons for use by JCR clients that shouldn't have to know anything about the SPI.

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


[jira] Commented: (JCR-2301) CND support in jackrabbit-jcr-commons

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12753592#action_12753592 ] 

Michael Dürig commented on JCR-2301:
------------------------------------

I still prefer to keep the parser independent. Although it adds some complexity (in particular AbstractItemTypeDefinitionsBuilder and its implementations), it adds a great deal of flexibility. Also that way, changes to client code is minimal. 

With the proposed patch it is quite easy to parametrize the parser such that it generates a JCR 2.0 API *Template bases representation of the CND. Just implement an AbstractItemTypeDefinitionsBuilder<NodeTypeTemplate, N...> and pass it to CompactNodeTypeDefReader's constructor. 

Also note that the parser is currently used to create two different representations of the CND (one in core, another in spi). AFAIU you want to use it to create yet another representation (JCR API node types/templates). Therefore I think it doesn't make sense to move the parser close to one specific representation. BTW it was moved from core to spi already (JCR-1516) because we then thought the spi representation would be the more general one. 

> CND support in jackrabbit-jcr-commons
> -------------------------------------
>
>                 Key: JCR-2301
>                 URL: https://issues.apache.org/jira/browse/JCR-2301
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons, nodetype
>            Reporter: Jukka Zitting
>         Attachments: JCR-2301-poc.patch
>
>
> It would be nice if the CND parsing functionality in spi-commons could be made available in jcr-commons for use by JCR clients that shouldn't have to know anything about the SPI.

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


[jira] Commented: (JCR-2301) CND support in jackrabbit-jcr-commons

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12753535#action_12753535 ] 

Jukka Zitting commented on JCR-2301:
------------------------------------

Just thinking, why does the CND reader even need to be able to directly create the Q objects?

> CND support in jackrabbit-jcr-commons
> -------------------------------------
>
>                 Key: JCR-2301
>                 URL: https://issues.apache.org/jira/browse/JCR-2301
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons, nodetype
>            Reporter: Jukka Zitting
>         Attachments: JCR-2301-poc.patch
>
>
> It would be nice if the CND parsing functionality in spi-commons could be made available in jcr-commons for use by JCR clients that shouldn't have to know anything about the SPI.

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


[jira] Updated: (JCR-2301) CND support in jackrabbit-jcr-commons

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Dürig updated JCR-2301:
-------------------------------

    Attachment: JCR-2301-poc.patch

Proof of concept patch. 

Class CompactNodeTypeDefReader is parametrized now: 

  class CompactNodeTypeDefReader<T, N> 

where T is the types to build, and N the namespace mapping to use. CompactNodeTypeDefReader constructor takes a builder for these types. Builders must derived from AbstractItemTypeDefinitionsBuilder<T, N>. 

CompactNodeTypeDefReader, AbstractItemTypeDefinitionsBuilder and related classes do not have any SPI dependencies anymore

Missing yet:
- JavaDoc is hopefully out dated
- everything still in spi-commons
- CompactNodeTypeDefReader.read needs to move to utility class since it ties in spi dependencies. 



> CND support in jackrabbit-jcr-commons
> -------------------------------------
>
>                 Key: JCR-2301
>                 URL: https://issues.apache.org/jira/browse/JCR-2301
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons, nodetype
>            Reporter: Jukka Zitting
>         Attachments: JCR-2301-poc.patch
>
>
> It would be nice if the CND parsing functionality in spi-commons could be made available in jcr-commons for use by JCR clients that shouldn't have to know anything about the SPI.

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


[jira] Commented: (JCR-2301) CND support in jackrabbit-jcr-commons

Posted by "Alexander Klimetschek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12753081#action_12753081 ] 

Alexander Klimetschek commented on JCR-2301:
--------------------------------------------

> Instead it should use the standard JCR factory methods to build the type templates

Ah, you are right, I missed them. Well, that makes it even simpler.

> The process needs to be a bit more general.

I think it would be ok to duplicate the parser code here, since it's stable and for the sake of library minification. That way the parser in spi-commons can be optimized for the spi use case, and the one in jcr-commons is as simple as possible.

> CND support in jackrabbit-jcr-commons
> -------------------------------------
>
>                 Key: JCR-2301
>                 URL: https://issues.apache.org/jira/browse/JCR-2301
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons, nodetype
>            Reporter: Jukka Zitting
>
> It would be nice if the CND parsing functionality in spi-commons could be made available in jcr-commons for use by JCR clients that shouldn't have to know anything about the SPI.

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


[jira] Commented: (JCR-2301) CND support in jackrabbit-jcr-commons

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12754077#action_12754077 ] 

Marcel Reutegger commented on JCR-2301:
---------------------------------------

Feedback on JCR-2301.patch:

- can we move the Q*DefinitionsBuilder one package up? I think those are not only useful in context of CND reading but in general to build a Q*Definition instances.

> CND support in jackrabbit-jcr-commons
> -------------------------------------
>
>                 Key: JCR-2301
>                 URL: https://issues.apache.org/jira/browse/JCR-2301
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons, nodetype
>            Reporter: Jukka Zitting
>         Attachments: JCR-2301-poc.patch, JCR-2301.patch
>
>
> It would be nice if the CND parsing functionality in spi-commons could be made available in jcr-commons for use by JCR clients that shouldn't have to know anything about the SPI.

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