You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "David Buchmann (Created) (JIRA)" <ji...@apache.org> on 2012/03/23 09:01:42 UTC
[jira] [Created] (JCR-3273) setting/getting jcr:mixinTypes as
property
setting/getting jcr:mixinTypes as property
------------------------------------------
Key: JCR-3273
URL: https://issues.apache.org/jira/browse/JCR-3273
Project: Jackrabbit Content Repository
Issue Type: Bug
Affects Versions: 2.4
Reporter: David Buchmann
Priority: Minor
using jackrabbit 2.4 (the remoting with davex, not tested with others) i can set the property jcr:mixinTypes to a node without getting an exception. before saving, the property is there but isNodeType returns false. when i save and read the node in a new session, it loses the property completely. if i set the mixin with addMixin, i can get it as property afterwards.
i am a bit confused by this. i guess it makes sense to not allow setting the mixin with setProperty - but then this should throw some exception to tell me i am wrong.
Node root = s.getRootNode();
Node node = root.getNode("my_node");
node.setProperty("jcr:mixinTypes", "mix:referenceable");
System.out.println(node.getProperty("jcr:mixinTypes").getString()); // mix:referenceable
System.out.println(node.isNodeType("mix:referenceable")); // false
s.save();
// neither a normal property nor a mixin type is stored
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (JCR-3273) [remoting] setting/getting
jcr:mixinTypes as property
Posted by "Stefan Guggisberg (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-3273?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stefan Guggisberg updated JCR-3273:
-----------------------------------
Component/s: jackrabbit-jcr-server
jackrabbit-jcr-client
Summary: [remoting] setting/getting jcr:mixinTypes as property (was: setting/getting jcr:mixinTypes as property)
> [remoting] setting/getting jcr:mixinTypes as property
> -----------------------------------------------------
>
> Key: JCR-3273
> URL: https://issues.apache.org/jira/browse/JCR-3273
> Project: Jackrabbit Content Repository
> Issue Type: Bug
> Components: jackrabbit-jcr-client, jackrabbit-jcr-server
> Affects Versions: 2.4
> Reporter: David Buchmann
> Priority: Minor
>
> using jackrabbit 2.4 (the remoting with davex, not tested with others) i can set the property jcr:mixinTypes to a node without getting an exception. before saving, the property is there but isNodeType returns false. when i save and read the node in a new session, it loses the property completely. if i set the mixin with addMixin, i can get it as property afterwards.
> i am a bit confused by this. i guess it makes sense to not allow setting the mixin with setProperty - but then this should throw some exception to tell me i am wrong.
> Node root = s.getRootNode();
> Node node = root.getNode("my_node");
> node.setProperty("jcr:mixinTypes", "mix:referenceable");
> System.out.println(node.getProperty("jcr:mixinTypes").getString()); // mix:referenceable
> System.out.println(node.isNodeType("mix:referenceable")); // false
> s.save();
> // neither a normal property nor a mixin type is stored
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (JCR-3273) [remoting] setting/getting
jcr:mixinTypes as property
Posted by "angela (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-3273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13236475#comment-13236475 ]
angela commented on JCR-3273:
-----------------------------
> System.out.println(node.getProperty("jcr:mixinTypes").getString()); // mix:referenceable
> System.out.println(node.isNodeType("mix:referenceable")); // false
in jcr2spi that's always the case before the changes are saved (even if using Node#addMixin) and this is spec compliant
regarding
> node.setProperty("jcr:mixinTypes", "mix:referenceable");
> s.save();
well... if your node is nt:unstructured then that would most probably not result in the
"regular" jcr:mixinTypes property but one with that name (any name is allowed with nt:unstructured)
and property type STRING that was not recognized as a the protected property you are expecting
to create.... you could equally create it with a BINARY value.
so, on the client side there is no way to found out that you did something illegal.
what remains:
> // neither a normal property nor a mixin type is stored
this however is odd. could you try this out on a regular jackrabbit-core? that would
be helpful to find out where exactly that problem is located. thanks.
> [remoting] setting/getting jcr:mixinTypes as property
> -----------------------------------------------------
>
> Key: JCR-3273
> URL: https://issues.apache.org/jira/browse/JCR-3273
> Project: Jackrabbit Content Repository
> Issue Type: Bug
> Components: jackrabbit-jcr-client, jackrabbit-jcr-server
> Affects Versions: 2.4
> Reporter: David Buchmann
> Priority: Minor
>
> using jackrabbit 2.4 (the remoting with davex, not tested with others) i can set the property jcr:mixinTypes to a node without getting an exception. before saving, the property is there but isNodeType returns false. when i save and read the node in a new session, it loses the property completely. if i set the mixin with addMixin, i can get it as property afterwards.
> i am a bit confused by this. i guess it makes sense to not allow setting the mixin with setProperty - but then this should throw some exception to tell me i am wrong.
> Node root = s.getRootNode();
> Node node = root.getNode("my_node");
> node.setProperty("jcr:mixinTypes", "mix:referenceable");
> System.out.println(node.getProperty("jcr:mixinTypes").getString()); // mix:referenceable
> System.out.println(node.isNodeType("mix:referenceable")); // false
> s.save();
> // neither a normal property nor a mixin type is stored
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (JCR-3273) [remoting] setting/getting
jcr:mixinTypes as property
Posted by "David Buchmann (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-3273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13238212#comment-13238212 ]
David Buchmann commented on JCR-3273:
-------------------------------------
if jcr:mixinTypes is a legal property name, we also have the inconsistency that the real mixin types of a node get visible as a property jcr:mixinTypes - but would be hidden by the property if it is added. this feels weird.
> [remoting] setting/getting jcr:mixinTypes as property
> -----------------------------------------------------
>
> Key: JCR-3273
> URL: https://issues.apache.org/jira/browse/JCR-3273
> Project: Jackrabbit Content Repository
> Issue Type: Bug
> Components: jackrabbit-jcr-client, jackrabbit-jcr-server
> Affects Versions: 2.4
> Reporter: David Buchmann
> Priority: Minor
>
> using jackrabbit 2.4 (the remoting with davex, not tested with others) i can set the property jcr:mixinTypes to a node without getting an exception. before saving, the property is there but isNodeType returns false. when i save and read the node in a new session, it loses the property completely. if i set the mixin with addMixin, i can get it as property afterwards.
> i am a bit confused by this. i guess it makes sense to not allow setting the mixin with setProperty - but then this should throw some exception to tell me i am wrong.
> Node root = s.getRootNode();
> Node node = root.getNode("my_node");
> node.setProperty("jcr:mixinTypes", "mix:referenceable");
> System.out.println(node.getProperty("jcr:mixinTypes").getString()); // mix:referenceable
> System.out.println(node.isNodeType("mix:referenceable")); // false
> s.save();
> // neither a normal property nor a mixin type is stored
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (JCR-3273) [remoting] setting/getting
jcr:mixinTypes as property
Posted by "David Buchmann (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-3273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13236719#comment-13236719 ]
David Buchmann commented on JCR-3273:
-------------------------------------
i was thinking if jcr:mixinTypes is sort of a reserved keyword that can not be used for properties...
if its a valid property, then the davex json thing will have a problem as primarytype and mixinTypes are handled like properties there...
i can try to compile the example against jackrabbit-core. would you have an example or simple testscript like we have for davex with https://github.com/jackalope/JavaDavexClient ? if not i will try to hack my example into some functional test...
> [remoting] setting/getting jcr:mixinTypes as property
> -----------------------------------------------------
>
> Key: JCR-3273
> URL: https://issues.apache.org/jira/browse/JCR-3273
> Project: Jackrabbit Content Repository
> Issue Type: Bug
> Components: jackrabbit-jcr-client, jackrabbit-jcr-server
> Affects Versions: 2.4
> Reporter: David Buchmann
> Priority: Minor
>
> using jackrabbit 2.4 (the remoting with davex, not tested with others) i can set the property jcr:mixinTypes to a node without getting an exception. before saving, the property is there but isNodeType returns false. when i save and read the node in a new session, it loses the property completely. if i set the mixin with addMixin, i can get it as property afterwards.
> i am a bit confused by this. i guess it makes sense to not allow setting the mixin with setProperty - but then this should throw some exception to tell me i am wrong.
> Node root = s.getRootNode();
> Node node = root.getNode("my_node");
> node.setProperty("jcr:mixinTypes", "mix:referenceable");
> System.out.println(node.getProperty("jcr:mixinTypes").getString()); // mix:referenceable
> System.out.println(node.isNodeType("mix:referenceable")); // false
> s.save();
> // neither a normal property nor a mixin type is stored
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira