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 2006/11/23 19:34:03 UTC

[jira] Reopened: (JCR-644) Node.isNodeType() throws if namespace is not defined.

     [ http://issues.apache.org/jira/browse/JCR-644?page=all ]

Jukka Zitting reopened JCR-644:
-------------------------------

             
I disagree.

Assume that in the context of the client application the "foo" prefix corresponds to the namespace "MyNamespace". Now, it could be that "MyNamespace" is actually mapped to the prefix "bar" in my repository for some local administrative reason. Then, a node with the node type "{MyNamespace}MyNodeType" would return false for node.isNodeType("foo:MyNodeType"), which would obviously be incorrect from the client perspective.

If a client doesn't check the existence of the namespace with session.getNamespacePrefix("MyNamespace") or explicitly align the naming context with session.setNamespacePrefix("foo", "MyNamespace"), it implicitly assumes that the repository already contains both the namespace *and* the correct prefix mapping. If these assumptions are incorrect, throwing an exception is IMHO the best the repository can do.

> Node.isNodeType() throws if namespace is not defined.
> -----------------------------------------------------
>
>                 Key: JCR-644
>                 URL: http://issues.apache.org/jira/browse/JCR-644
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: nodetype
>    Affects Versions: 1.0, 1.0.1, 1.1, 0.9
>            Reporter: Tobias Bocanegra
>         Assigned To: Tobias Bocanegra
>
> eg: node.isNodeType("foo:MyNodeType")
> throws an exception if 'foo' is not defined. this is incorrect since an application should not need to check if the namespace exists before checking for a nodetype. it should return false.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira