Expand my Community achievements bar.

SOLVED

Creating Private Collection Programmatically

Avatar

Level 3

Hi Everyone,

I'm looking for ways to create collection that is not public using the ResourceCollection API (or without it). I'm able to crate once that are Public and then the user can convert them to private using the Settings menu but I'm looking for a way to do it programmatically. Is there any API for that? I see that all private collections have 4 allow access control entries and 3 user groups are being created for each (<name>, <name>-owner, and <name>-editor). I tried replicating all that but wasn't very successful. 

Any help would be be greatly appreciated.

Thank you,

Bobby

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi Bobby,

I see this as per AEM 6.4

I have 3 collections as shown here

Screen Shot 2018-08-10 at 3.32.59 PM.png

in which only 'parent-child' is the public collection.

So when you look at the JCR,

Screen Shot 2018-08-10 at 3.33.08 PM.png

there is a node called 'public' under /content/dam/collections and only that public collection is present under this node. So as long as you dont create the collection under 'public' folder, it shouldnt be public.

Having said that, I dont think we have direct option in the API to control this.

View solution in original post

6 Replies

Avatar

Level 10

I am not clear what you are trying to do. Please point to the related AEM docs you are following here.

Avatar

Level 10

A DAM collection - that is much clearer. I will inquire about this. I am not sure we have any examples on this.

Avatar

Correct answer by
Level 10

Hi Bobby,

I see this as per AEM 6.4

I have 3 collections as shown here

Screen Shot 2018-08-10 at 3.32.59 PM.png

in which only 'parent-child' is the public collection.

So when you look at the JCR,

Screen Shot 2018-08-10 at 3.33.08 PM.png

there is a node called 'public' under /content/dam/collections and only that public collection is present under this node. So as long as you dont create the collection under 'public' folder, it shouldnt be public.

Having said that, I dont think we have direct option in the API to control this.

Avatar

Level 1
I am trying to create private collection (similar to one mentioned in above question) I have found one service that is present "com.day.cq.dam.core.impl.collection.DamCollectionManager" but unable to use it as its unable to resolve while trying to import the service. Any help here would great.

Avatar

Level 2

Hi All , did we get a solution here how to create private collection programmatically.