Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

Problem Creating Assets with AssetManager

Avatar

Level 2

So I have found a fix for this problem but I wanted to know why its happening and if it means my implementation is wrong somewhere.

I am using AssetManager from the com.day.cq.dam.api package and creating PDF assets with the line:

assetManager.createAsset(path, inputStream, "application/pdf", true);

Although they are being created and show up in the forms portal they don't have all the functionality that a pdf form has if I just manually upload it through the portal itself. The only options I have are to select the form and download it, if I then attempt to download the form as a binary file I get the error "Unable to detect the asset type".

I looked at the differences between manually loaded assets and my created asset and the solution for me was adding the property:

name: pdfForm

type: long

value: 1

to the jcr:content node under the new asset.

I'm mostly curious if this is just an accepted problem or If it gets the type somewhere other than mimetype: application/pdf.

1 Accepted Solution

Avatar

Correct answer by
Level 7

As Mayank Gandhi​ has already said - you have to use the AEM Forms asset services to upload your PDF for Forms Portal to see the additional metadata. Reason is, they are two different upload services and the AEM Forms asset service adds in extra metadata to the PDF. They both share the same DAM workflow process to extract the rest of the metadata from the PDF when putting it into the DAM.

The AEM Forms Asset handler is located somewhere in com.adobe.livecycle.formsmanagement package I think which I am not sure has a public API.

View solution in original post

2 Replies

Avatar

Employee Advisor

The supported method for import/export of assets to forms portal is listed in the below-mentioned document. However, I would like to know what is the expected end result you seek, is it the pdf form working or using API for the asset creation?

Adobe Experience Manager Help | Importing and exporting assets to AEM Forms

Avatar

Correct answer by
Level 7

As Mayank Gandhi​ has already said - you have to use the AEM Forms asset services to upload your PDF for Forms Portal to see the additional metadata. Reason is, they are two different upload services and the AEM Forms asset service adds in extra metadata to the PDF. They both share the same DAM workflow process to extract the rest of the metadata from the PDF when putting it into the DAM.

The AEM Forms Asset handler is located somewhere in com.adobe.livecycle.formsmanagement package I think which I am not sure has a public API.