jcr:mixinTypes property | Community
Skip to main content
Singaiah_Chintalapudi
Level 7
May 19, 2016 10:25 PM UTC
Solved

jcr:mixinTypes property

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Singaiah_Chintalapudi
Singaiah_ChintalapudiAccepted solution
Level 7
May 23, 2016 5:51 PM UTC

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

10 replies

kpawan
Level 2
May 2, 2022 9:00 PM UTC

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.

Translate
May 23, 2016 8:20 PM UTC

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.

Translate
Singaiah_Chintalapudi
Singaiah_ChintalapudiAuthorAccepted solution
Level 7
May 23, 2016 5:51 PM UTC

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

Translate
kautuk_sahni
Employee
Mar 26, 2021 8:08 AM UTC
@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.
Translate
Kautuk Sahni
Singaiah_Chintalapudi
Level 7
May 23, 2016 12:30 PM UTC

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. 

Translate
Deepikaa_Nagesh
Level 3
May 23, 2016 10:07 AM UTC

Hi,

hope you are using Node.addMixin method?

If not how exactly you are adding mixins to node?

 

Thanks,

Deepikaa

Translate
Singaiah_Chintalapudi
Level 7
May 20, 2016 3:10 PM UTC

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?

Translate
debashisghosh
Level 2
Oct 4, 2020 4:15 PM UTC

Hi @singaiah_chintalapudi,

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

Translate