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

AEM Cloud Service - Unique assets check while uploading files to AEM in browser (avoid duplicate file names) | AEM Community Blog Seeding

Avatar

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,168 likes

Total Posts

6,289 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,168 likes

Total Posts

6,289 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile
kautuk_sahni
Community Manager

04-02-2021

BlogImage.jpg

AEM Cloud Service - Unique assets check while uploading files to AEM in browser (avoid duplicate fil... by Sreekanth Choudry Nalabotu

Abstract

AEM Cloud Service Version : 2021.1.4738.20210107T143101Z-201217 (Jan 7, 2021)

Goal
Adding the following extension would restrict users from uploading duplicates files (files with same name). The check is done repository wide /content/dam

Solution
1) Create a service user configuration in repo init script ui.config\src\main\content\jcr_root\apps\eaem-cs-upload-unique-assets\osgiconfig\config.author\org.apache.sling.jcr.repoinit.RepositoryInitializer-eaem.config this is for querying and returning duplicates as JSON (in next steps).

scripts=[
"
create service user eaem-service-user with path system/cq:services/experience-aem
set principal ACL for eaem-service-user
allow jcr:read on /apps
allow jcr:read on /content/dam
end
"
]

2) Adding the above repo init script in code repo and installing on AEM CS creates a service user in /home/users/system/cq:services/experience-aem

3) Add the service user to bundle mapping in ui.config\src\main\content\jcr_root\apps\eaem-cs-upload-unique-assets\osgiconfig\config.author\org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended-eaem.xml


Read Full Blog

AEM Cloud Service - Unique assets check while uploading files to AEM in browser (avoid duplicate fil...

Q&A

Please use this thread to ask the related questions.

AEM AEMEBlogSeeding Experience Manager