Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

AEM Cloud Service - Run Assets Bulk Import Using PostMan | AEM Community Blog Seeding

Avatar

Administrator

6/20/23

BlogImage.jpg

AEM Cloud Service - Run Assets Bulk Import Using PostMan by Sreekanth Choudry Nalabotu

Abstract

Kickoff Bulk Import from AEM

@Reference
private SlingRequestProcessor slingRequestProcessor;

@Reference
private RequestResponseFactory requestResponseFactory;

private static final String IMPORT_JOB_URL = "/conf/global/settings/dam/import/bulk-import-config-name.importJob.json";

private void runBulkImport(final ResourceResolver resolver){
final Map<String, Object> requestParams = new ConcurrentHashMap<>();
requestParams.put("operation", "run");

final HttpServletRequest request = requestResponseFactory.createRequest("POST", IMPORT_JOB_URL,
requestParams);
final ByteArrayOutputStream bos = new ByteArrayOutputStream();

final HttpServletResponse response = this.requestResponseFactory.createResponse(bos);
try {
slingRequestProcessor.processRequest(request, response, resolver);
} catch (ServletException | IOException e) {
logger.error("Error while running bulk import ", e);
}
}

Read Full Blog

AEM Cloud Service - Run Assets Bulk Import Using PostMan

Q&A

Please use this thread to ask the related questions.

4 Comments