You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by "Michael Mertins (JIRA)" <ji...@apache.org> on 2009/09/15 17:55:57 UTC

[jira] Created: (CMIS-52) Discovery Node Types Dynamically

Discovery Node Types Dynamically
--------------------------------

                 Key: CMIS-52
                 URL: https://issues.apache.org/jira/browse/CMIS-52
             Project: Chemistry
          Issue Type: Improvement
          Components: jcr
            Reporter: Michael Mertins
            Priority: Minor


Node types have to be discovered dynamically in order to allow customized node types and nodes to be read.

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


[jira] Updated: (CMIS-52) Discovery Node Types Dynamically

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

Michael Mertins updated CMIS-52:
--------------------------------

    Attachment: patch_chemistry061_jcr_dynamic_nodetypes.txt

> Discovery Node Types Dynamically
> --------------------------------
>
>                 Key: CMIS-52
>                 URL: https://issues.apache.org/jira/browse/CMIS-52
>             Project: Chemistry
>          Issue Type: Improvement
>          Components: jcr
>            Reporter: Michael Mertins
>            Priority: Minor
>         Attachments: patch_chemistry061_jcr_dynamic_nodetypes.txt
>
>
> Node types have to be discovered dynamically in order to allow customized node types and nodes to be read.

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


[jira] Commented: (CMIS-52) Discovery Node Types Dynamically

Posted by "Florent Guillaume (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CMIS-52?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12756614#action_12756614 ] 

Florent Guillaume commented on CMIS-52:
---------------------------------------

Hi,
Your code refers to JcrCmisMap#isBaseTypeDocument which is not included in the patch...

Stylistic notes:

- you're going overboard parenthesizing boolean tests, for instance this:
                    if ((typeId == null) || (typeId.equals(baseType.toString()))) {
can be simply:
                    if (typeId == null || typeId.equals(baseType.toString())) {

- this can be simplified:
                NodeType nodeType = (NodeType) allNodeTypesIter.next();
into:
                NodeType nodeType = allNodeTypesIter.nextNodeType();

- You code:
                if (((!(result.size() > maxItems)) || (maxItems == 0))
                        && (!nodeType.isMixin())) {
                    // If typeId is provided, only the specific type and its
                    // descendants are returned, otherwise all types are
                    // returned.
                    if ((typeId == null)
                            || (typeId.equals(baseType.toString()))) {
                        result.add(new JcrType(nodeType, baseType));
                    }
                }
I'd rather write (exit early):
                if (nodeType.isMixin()) { // could be moved even higher in the while block
                    continue;
                }
                if (typeId == null || typeId.equals(baseType.toString())) {
                    // If typeId is provided, only the specific type and its
                    // descendants are returned, otherwise all types are
                    // returned.
                    result.add(new JcrType(nodeType, baseType));
                    if (maxItems != 0 && result.size() > maxItems) {
                        break;
                    }
                }


> Discovery Node Types Dynamically
> --------------------------------
>
>                 Key: CMIS-52
>                 URL: https://issues.apache.org/jira/browse/CMIS-52
>             Project: Chemistry
>          Issue Type: Improvement
>          Components: jcr
>            Reporter: Michael Mertins
>            Priority: Minor
>         Attachments: patch_chemistry061_jcr_dynamic_nodetypes.txt
>
>
> Node types have to be discovered dynamically in order to allow customized node types and nodes to be read.

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


[jira] Resolved: (CMIS-52) Discovery Node Types Dynamically

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

Michael Mertins resolved CMIS-52.
---------------------------------

    Resolution: Won't Fix

Thanks for the change suggestions. I integrated them and the whole Node Type Discovery into  my patch for CMIS-46 CMIS - JCR Mapping because they are interrelated and the JcrCmisMap File is there, too.

> Discovery Node Types Dynamically
> --------------------------------
>
>                 Key: CMIS-52
>                 URL: https://issues.apache.org/jira/browse/CMIS-52
>             Project: Chemistry
>          Issue Type: Improvement
>          Components: jcr
>            Reporter: Michael Mertins
>            Priority: Minor
>         Attachments: patch_chemistry061_jcr_dynamic_nodetypes.txt
>
>
> Node types have to be discovered dynamically in order to allow customized node types and nodes to be read.

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


[jira] Issue Comment Edited: (CMIS-52) Discovery Node Types Dynamically

Posted by "Florent Guillaume (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CMIS-52?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12756614#action_12756614 ] 

Florent Guillaume edited comment on CMIS-52 at 9/17/09 9:25 AM:
----------------------------------------------------------------

Hi,
Your code refers to JcrCmisMap#isBaseTypeDocument which is not included in the patch...

Stylistic notes:

- you're going overboard parenthesizing boolean tests, for instance this:
{code}
                    if ((typeId == null) || (typeId.equals(baseType.toString()))) {
{code}
can be simply:
{code}
                    if (typeId == null || typeId.equals(baseType.toString())) {
{code}

- this can be simplified:
{code}
                NodeType nodeType = (NodeType) allNodeTypesIter.next();
{code}
into:
{code}
                NodeType nodeType = allNodeTypesIter.nextNodeType();
{code}

- your code:
{code}
                if (((!(result.size() > maxItems)) || (maxItems == 0))
                        && (!nodeType.isMixin())) {
                    // If typeId is provided, only the specific type and its
                    // descendants are returned, otherwise all types are
                    // returned.
                    if ((typeId == null)
                            || (typeId.equals(baseType.toString()))) {
                        result.add(new JcrType(nodeType, baseType));
                    }
                }
{code}
I'd rather write (exit early):
{code}
                if (nodeType.isMixin()) { // could be moved even higher in the while block
                    continue;
                }
                if (typeId == null || typeId.equals(baseType.toString())) {
                    // If typeId is provided, only the specific type and its
                    // descendants are returned, otherwise all types are
                    // returned.
                    result.add(new JcrType(nodeType, baseType));
                    if (maxItems != 0 && result.size() > maxItems) {
                        break;
                    }
                }
{code}


      was (Author: fguillaume):
    Hi,
Your code refers to JcrCmisMap#isBaseTypeDocument which is not included in the patch...

Stylistic notes:

- you're going overboard parenthesizing boolean tests, for instance this:
                    if ((typeId == null) || (typeId.equals(baseType.toString()))) {
can be simply:
                    if (typeId == null || typeId.equals(baseType.toString())) {

- this can be simplified:
                NodeType nodeType = (NodeType) allNodeTypesIter.next();
into:
                NodeType nodeType = allNodeTypesIter.nextNodeType();

- You code:
                if (((!(result.size() > maxItems)) || (maxItems == 0))
                        && (!nodeType.isMixin())) {
                    // If typeId is provided, only the specific type and its
                    // descendants are returned, otherwise all types are
                    // returned.
                    if ((typeId == null)
                            || (typeId.equals(baseType.toString()))) {
                        result.add(new JcrType(nodeType, baseType));
                    }
                }
I'd rather write (exit early):
                if (nodeType.isMixin()) { // could be moved even higher in the while block
                    continue;
                }
                if (typeId == null || typeId.equals(baseType.toString())) {
                    // If typeId is provided, only the specific type and its
                    // descendants are returned, otherwise all types are
                    // returned.
                    result.add(new JcrType(nodeType, baseType));
                    if (maxItems != 0 && result.size() > maxItems) {
                        break;
                    }
                }

  
> Discovery Node Types Dynamically
> --------------------------------
>
>                 Key: CMIS-52
>                 URL: https://issues.apache.org/jira/browse/CMIS-52
>             Project: Chemistry
>          Issue Type: Improvement
>          Components: jcr
>            Reporter: Michael Mertins
>            Priority: Minor
>         Attachments: patch_chemistry061_jcr_dynamic_nodetypes.txt
>
>
> Node types have to be discovered dynamically in order to allow customized node types and nodes to be read.

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