You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Michael Dürig (JIRA)" <ji...@apache.org> on 2007/09/18 16:31:44 UTC

[jira] Created: (JCR-1140) NodeId for root node should not be hardcoded in jcr2spi

NodeId for root node should not be hardcoded in jcr2spi
-------------------------------------------------------

                 Key: JCR-1140
                 URL: https://issues.apache.org/jira/browse/JCR-1140
             Project: Jackrabbit
          Issue Type: Bug
          Components: SPI
            Reporter: Michael Dürig


org.apache.jackrabbit.jcr2spi.hierarchy.NodeId.getId() always returns idFactory.createNodeId((String) null, Path.ROOT) for the root node although a repository might want to reference the root node by UUID. NodeId.getId() breaks the contract of org.apache.jackrabbit.spi.ItemId which for this case states: "The item can not be identified with a unique ID and none of its ancestors can be identified with a unique ID. The item is identified by an absolute path".

I suggest to change the implementation such that when NodeId.getId() needs to return the NodeId of the root node a round trip to org.apache.jackrabbit.spi.RepositoryService.getRootId() is done. 

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


[jira] Commented: (JCR-1140) NodeId for root node should not be hardcoded in jcr2spi

Posted by "angela (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12530742 ] 

angela commented on JCR-1140:
-----------------------------

> org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntryImpl.getId() always returns idFactory.createNodeId((String) 
> null, Path.ROOT) for the root node 

i think this is not true. this is only the case if the root entry does not have a uniqueID defined.
the uniqueID gets set upon retrieval of the entry or of a child-entry, whose ItemID is composed of the uniqueID of an ancestor and a path.

or do you mean a different thing?

from my point of view, the first issue you  describe (and the subject refers to) is not given or at least it's a 
different issue.

for the second one (spi2jcr): that wrong. but can you please open a different issue for that?  thanks
angela

> NodeId for root node should not be hardcoded in jcr2spi
> -------------------------------------------------------
>
>                 Key: JCR-1140
>                 URL: https://issues.apache.org/jira/browse/JCR-1140
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: SPI
>            Reporter: Michael Dürig
>
> org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntryImpl.getId() always returns idFactory.createNodeId((String) null, Path.ROOT) for the root node although a repository might want to reference the root node by UUID. NodeId.getId() breaks the contract of org.apache.jackrabbit.spi.ItemId which for this case states: "The item can not be identified with a unique ID and none of its ancestors can be identified with a unique ID. The item is identified by an absolute path".
> I suggest to change the implementation such that when NodeId.getId() needs to return the NodeId of the root node a round trip to org.apache.jackrabbit.spi.RepositoryService.getRootId() is done. 

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


[jira] Commented: (JCR-1140) NodeId for root node should not be hardcoded in jcr2spi

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

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

Ok I got it. The source of confusion stems from the javadoc of ItemId which only covers the case for already existing items (i.e. instances of Item). It says that if an item can be identified with an unique ID then an ItemId identifying this item will use that ID (and not the path). However, when an item is about to be constructed, RepositoryService.getItemInfos() might get called with a NodeId using a Path even though the item will be identifiable with an unique ID.

In short: from a spi2something developer's perspective the documentation gives the impression that RepositoryService.getItemInfos() is always called with the same ItemId (in respect to ID and path) for a given NodeInfo. But this is not the case for items with uniqueIds.

> NodeId for root node should not be hardcoded in jcr2spi
> -------------------------------------------------------
>
>                 Key: JCR-1140
>                 URL: https://issues.apache.org/jira/browse/JCR-1140
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: SPI
>            Reporter: Michael Dürig
>
> org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntryImpl.getId() always returns idFactory.createNodeId((String) null, Path.ROOT) for the root node although a repository might want to reference the root node by UUID. NodeId.getId() breaks the contract of org.apache.jackrabbit.spi.ItemId which for this case states: "The item can not be identified with a unique ID and none of its ancestors can be identified with a unique ID. The item is identified by an absolute path".
> I suggest to change the implementation such that when NodeId.getId() needs to return the NodeId of the root node a round trip to org.apache.jackrabbit.spi.RepositoryService.getRootId() is done. 

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


[jira] Commented: (JCR-1140) NodeId for root node should not be hardcoded in jcr2spi

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

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

Along the same line I think org.apache.jackrabbit.spi2jcr.RepositoryServiceImpl.getRootId() should not return getIdFactory().createNodeId((String) null, Path.ROOT). Rather should it do a round trip to the wrapped repository and return a UUID based NodeId if the root node of the wrapped repository is mix:referenceable.

> NodeId for root node should not be hardcoded in jcr2spi
> -------------------------------------------------------
>
>                 Key: JCR-1140
>                 URL: https://issues.apache.org/jira/browse/JCR-1140
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: SPI
>            Reporter: Michael Dürig
>
> org.apache.jackrabbit.jcr2spi.hierarchy.NodeId.getId() always returns idFactory.createNodeId((String) null, Path.ROOT) for the root node although a repository might want to reference the root node by UUID. NodeId.getId() breaks the contract of org.apache.jackrabbit.spi.ItemId which for this case states: "The item can not be identified with a unique ID and none of its ancestors can be identified with a unique ID. The item is identified by an absolute path".
> I suggest to change the implementation such that when NodeId.getId() needs to return the NodeId of the root node a round trip to org.apache.jackrabbit.spi.RepositoryService.getRootId() is done. 

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


[jira] Commented: (JCR-1140) NodeId for root node should not be hardcoded in jcr2spi

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

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

> for the second one (spi2jcr): that wrong. but can you please open a different issue for that? 
See https://issues.apache.org/jira/browse/JCR-1147

> NodeId for root node should not be hardcoded in jcr2spi
> -------------------------------------------------------
>
>                 Key: JCR-1140
>                 URL: https://issues.apache.org/jira/browse/JCR-1140
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: SPI
>            Reporter: Michael Dürig
>
> org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntryImpl.getId() always returns idFactory.createNodeId((String) null, Path.ROOT) for the root node although a repository might want to reference the root node by UUID. NodeId.getId() breaks the contract of org.apache.jackrabbit.spi.ItemId which for this case states: "The item can not be identified with a unique ID and none of its ancestors can be identified with a unique ID. The item is identified by an absolute path".
> I suggest to change the implementation such that when NodeId.getId() needs to return the NodeId of the root node a round trip to org.apache.jackrabbit.spi.RepositoryService.getRootId() is done. 

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


[jira] Resolved: (JCR-1140) NodeId for root node should not be hardcoded in jcr2spi

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

angela resolved JCR-1140.
-------------------------

    Resolution: Invalid

> NodeId for root node should not be hardcoded in jcr2spi
> -------------------------------------------------------
>
>                 Key: JCR-1140
>                 URL: https://issues.apache.org/jira/browse/JCR-1140
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: SPI
>            Reporter: Michael Dürig
>
> org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntryImpl.getId() always returns idFactory.createNodeId((String) null, Path.ROOT) for the root node although a repository might want to reference the root node by UUID. NodeId.getId() breaks the contract of org.apache.jackrabbit.spi.ItemId which for this case states: "The item can not be identified with a unique ID and none of its ancestors can be identified with a unique ID. The item is identified by an absolute path".
> I suggest to change the implementation such that when NodeId.getId() needs to return the NodeId of the root node a round trip to org.apache.jackrabbit.spi.RepositoryService.getRootId() is done. 

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


[jira] Commented: (JCR-1140) NodeId for root node should not be hardcoded in jcr2spi

Posted by "angela (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12531799 ] 

angela commented on JCR-1140:
-----------------------------

ok. it seems that this issue can be resolved, since it turns out to be a misunderstanding due to missing 
documentation in the spi.

i added some more javadoc to IdFactory with rev. 581235  


> NodeId for root node should not be hardcoded in jcr2spi
> -------------------------------------------------------
>
>                 Key: JCR-1140
>                 URL: https://issues.apache.org/jira/browse/JCR-1140
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: SPI
>            Reporter: Michael Dürig
>
> org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntryImpl.getId() always returns idFactory.createNodeId((String) null, Path.ROOT) for the root node although a repository might want to reference the root node by UUID. NodeId.getId() breaks the contract of org.apache.jackrabbit.spi.ItemId which for this case states: "The item can not be identified with a unique ID and none of its ancestors can be identified with a unique ID. The item is identified by an absolute path".
> I suggest to change the implementation such that when NodeId.getId() needs to return the NodeId of the root node a round trip to org.apache.jackrabbit.spi.RepositoryService.getRootId() is done. 

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


[jira] Updated: (JCR-1140) NodeId for root node should not be hardcoded in jcr2spi

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

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

    Description: 
org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntryImpl.getId() always returns idFactory.createNodeId((String) null, Path.ROOT) for the root node although a repository might want to reference the root node by UUID. NodeId.getId() breaks the contract of org.apache.jackrabbit.spi.ItemId which for this case states: "The item can not be identified with a unique ID and none of its ancestors can be identified with a unique ID. The item is identified by an absolute path".

I suggest to change the implementation such that when NodeId.getId() needs to return the NodeId of the root node a round trip to org.apache.jackrabbit.spi.RepositoryService.getRootId() is done. 

  was:
org.apache.jackrabbit.jcr2spi.hierarchy.NodeId.getId() always returns idFactory.createNodeId((String) null, Path.ROOT) for the root node although a repository might want to reference the root node by UUID. NodeId.getId() breaks the contract of org.apache.jackrabbit.spi.ItemId which for this case states: "The item can not be identified with a unique ID and none of its ancestors can be identified with a unique ID. The item is identified by an absolute path".

I suggest to change the implementation such that when NodeId.getId() needs to return the NodeId of the root node a round trip to org.apache.jackrabbit.spi.RepositoryService.getRootId() is done. 


> NodeId for root node should not be hardcoded in jcr2spi
> -------------------------------------------------------
>
>                 Key: JCR-1140
>                 URL: https://issues.apache.org/jira/browse/JCR-1140
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: SPI
>            Reporter: Michael Dürig
>
> org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntryImpl.getId() always returns idFactory.createNodeId((String) null, Path.ROOT) for the root node although a repository might want to reference the root node by UUID. NodeId.getId() breaks the contract of org.apache.jackrabbit.spi.ItemId which for this case states: "The item can not be identified with a unique ID and none of its ancestors can be identified with a unique ID. The item is identified by an absolute path".
> I suggest to change the implementation such that when NodeId.getId() needs to return the NodeId of the root node a round trip to org.apache.jackrabbit.spi.RepositoryService.getRootId() is done. 

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