Creating Private Collection Programmatically | Community
Skip to main content
bobbym33667819
Level 3
August 10, 2018
Solved

Creating Private Collection Programmatically

  • August 10, 2018
  • 6 replies
  • 3802 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Lokesh_Shivalingaiah

Hi Bobby,

I see this as per AEM 6.4

I have 3 collections as shown here

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

So when you look at the JCR,

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.

6 replies

smacdonald2008
Level 10
August 10, 2018

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

bobbym33667819
Level 3
August 10, 2018

The only information I found was this.

I can successfully create the collection but can not make it not Public. 

Creating DAM Collection

ResourceCollection ("The Adobe AEM Quickstart and Web Application.")

ResourceCollectionManager ("The Adobe AEM Quickstart and Web Application.")

Thanks again.

smacdonald2008
Level 10
August 10, 2018

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

Lokesh_Shivalingaiah
Lokesh_ShivalingaiahAccepted solution
Level 10
August 10, 2018

Hi Bobby,

I see this as per AEM 6.4

I have 3 collections as shown here

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

So when you look at the JCR,

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.

mohammeda221545
March 29, 2021
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.
Level 2
February 8, 2024

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