Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Automatic, scheduled asset upload options.

Avatar

Level 1

Hello All!

I'm new to AEM technologies and been going through documentation, Internet and this forum looking for the best solution to apply.

We have a solution that uploas pdf files to a DAM using a webservice. we want to modify this solution to upload the pdf files now to "Assets" and assign metadata to the uploaded asset, I found  that there are a few options as:

  1. HTTP API POST requests to handle the upload of files. HTTP API
    1. Pros:
      1. since are http requests can be done easily in Java application
      2. Fits to our needs since are very basic tasks (upload & assign metadata)
    2. Cons
      1. The documentation is not clear about how to make the requests, tried Curl and could create folder  but file upload is not working with the parameters of the manual.
  2. Asset Manager API to upload files  Asset Manager API
    1. Pros
      1. have more options to upload and custom  to  our needs
      2. Can be used  with a UI to select the files to upload, pending to valdiate if can be modified to upload files automatically without the use of the UI.
    2. Cons
      1. The examples work with a UI
      2. There is still pending the step to assign metadata automatically

have you been through this requirements before? if  so what is your recommendation on the best way to implement this solution?

Thank you in advance to all!!

Luis Moreno

4 Replies

Avatar

Level 10

You can define a scheduler service that implements Runnable and have the scheduler kick off every so often. Say one every 2-3 hours. The service can scan a watched folder and them pull in any PDF it finds in the folder. Something like this:

Creating a Custom Watched Folder Service for Adobe Experience Manager 6.3

In your Service - use the Asset Manager API to place the PDF files into the AEM Dam. This article pulled in files into the AEM JCR, however, its an example and you will need to modify it to work with PDF files and also where you want to place the PDF files in the AEM JCR. .

Avatar

Level 10

Hi,

Yes, I too go with the approach Scott had suggested.

You can create the custom watched folder service with Scheduler. You an reference the article provided: Creating a Custom Watched Folder Service for Adobe Experience Manager 6.3

Here you need to work with PDF file rather than XML files.

Hope this helps!!

Thanks,

Ratna Kumar.

Avatar

Level 1

Thank you for your response guys!

edubey​, I was creating POST request using POSTMAN to test. I will put here later today the command I'm using.

So there is still the challenge to set the metadata for each asset. I did not mentioned before but the goal is not bulk upload but one by one since each PDF file need specific metadata. Even if we can bulk upload all, I sill need the reference to each one to add the required metadata one by one.

I'll think a bit on the options and get back to you on what we applied in case this can be of use to anyone else in the future.

Thank you!