Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

jcr:mixinTypes property

Singaiah_Chintalapudi
Community Advisor
Community Advisor

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.

1 Accepted Solution
Singaiah_Chintalapudi
Correct answer by
Community Advisor
Community Advisor

We have to add this mixinType before saving (session.save()).

View solution in original post

9 Replies
Singaiah_Chintalapudi
Community Advisor
Community Advisor

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?

debashisg292697
Level 2
Level 2

Hi @Singaiah_Chintalapudi,

Did you get a solution to this issue? Could you let me know any info on this?

AnjaliBiddanda
Level 2
Level 2

Did you try node.addMixin(" mix:lockable")', that should work.

Deepikaa_Nagesh
Level 3
Level 3

Hi,

hope you are using Node.addMixin method?

If not how exactly you are adding mixins to node?

 

Thanks,

Deepikaa

Singaiah_Chintalapudi
Community Advisor
Community Advisor

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. 

Singaiah_Chintalapudi
Correct answer by
Community Advisor
Community Advisor

We have to add this mixinType before saving (session.save()).

View solution in original post

kautuk_sahni
Community Manager
Community Manager
@Singaiah_Chintalapudi, good to see you back and thank you for sharing the solution with AEM community. Looking forward for your more contribution in the community. Good to have SMEs like you.
naniv22657571
Level 3
Level 3

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.