Hi,
I want to add the below property programatically:
Name: jcr:mixinTypes
Type: Name[]
Value: cq:LiveRelationship, cq:LiveSync, cq:LiveSyncCancelled
I am using JCR API but when I create this property, it is adding this property type as string[] not Name[]. Can anyone help me to resolve this issue?
Thanks.
Solved! Go to Solution.
Views
Replies
Total Likes
We have to add this mixinType before saving (session.save()).
noksc wrote...
Hi,
I want to add the below property programatically:
Name: jcr:mixinTypes
Type: Name[]
Value: cq:LiveRelationship, cq:LiveSync, cq:LiveSyncCancelled
I am using JCR API but when I create this property, it is adding this property type as string[] not Name[]. Can anyone help me to resolve this issue?
Thanks.
Can someone help me to solve this issue?
Did you get a solution to this issue? Could you let me know any info on this?
Views
Replies
Total Likes
Did you try node.addMixin(" mix:lockable")', that should work.
Views
Replies
Total Likes
Views
Replies
Total Likes
Hi,
hope you are using Node.addMixin method?
If not how exactly you are adding mixins to node?
Thanks,
Deepikaa
Deepikaa Nagesh wrote...
Hi,
hope you are using Node.addMixin method?
If not how exactly you are adding mixins to node?
Thanks,
Deepikaa
Yes. I have tried to use the same method.
http://www.day.com/specs/jsr170/javadocs/jcr-2.0/javax/jcr/Node.html#addMixin(java.lang.String)
But it is throwing exceptions.
We have to add this mixinType before saving (session.save()).
Views
Replies
Total Likes
String [] array = new String[]{"cq:LiveRelationship", "cq:LiveSync", "cq:LiveSyncCancelled"
};
Then set the property like below
node.setProperty(" jcr:mixinTypes",array);
node.getSesssion().Save();
Hope this would you are expecting.
Reply if you are not getting.
I faced similar problem while cancelling the inheritance of a component for multiple nodes and following code snippet worked for me -
Node node = getNode(String nodepath)
node.addMixin("cq:LiveSyncCancelled")
node.setProperty("cq:isCancelledForChildren","true",PropertyType.BOOLEAN)
session.save();
Note: I executed this on groovyconsole.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies