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
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Creating Private Collection Programmatically

bobbym33667819
Level 3
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
bsloki
Correct answer by
Community Advisor
Community Advisor

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

5 Replies
smacdonald2008
Level 10
Level 10

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

smacdonald2008
Level 10
Level 10

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

bsloki
Correct answer by
Community Advisor
Community Advisor

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

mohammeda221545
Level 1
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.