Expand my Community achievements bar.

SOLVED

Store Asset binary data outside AEM, and still reference it from within AEM

Avatar

Level 10

Hello,

Is there a way one could have the binary data of an asset stored elsewhere(outside of AEM, say CDN) and have a reference say a url , stored in metadata property in AEM,  pointing to where the asset is stored in CDN. The asset in CDN has the binary data.

Thus the asset in AEM has the refernce to the asset and its binary data in CDN. Is it possible to go about this approach?

Please suggest.

Regards,
NZ

1 Accepted Solution

Avatar

Correct answer by
Level 8

Ah I misunderstood your use case. There is no way use the DAM and store the binary somewhere else. Realistically you have 3 options in my opinion:

  1. Follow AEM standard and store and serve the binary from AEM. 
  2. Store the binary somewhere else and in the image components that render image on pages you store a reference to the binary in that other system and your image components point to that URL at run time. 
  3. Store the binary in AEM DAM and in the other system. One of the pieces of meta-data you store in AEM is a pointer to the binary in the other system. Then at runtime your image components use that point rather than the AEM URL. Depending on your process for creating these images you create a custom workflow that would publish and image to the other system. This is similar to how the Scene 7 integration works - http://dev.day.com/docs/en/cq/current/administering/integrating_with_adobe_marketing_cloud/scene7.ht...

View solution in original post

11 Replies

Avatar

Level 1

Hi,

CDNs are used for caching. You need to follow a particular convention

& process to achieve this after agreeing with your CDN provider. It is immaterial

if CDNs store in binary format or not. On a global scale you need to determine

from which geographic location your (browser) request is coming from.With more than

one CDN, fixing a url is probably not a good idea. If your CDN is finalized, I'd recommend

running through their manuals.

- Venu Gummadala

Avatar

Level 1

Great! A good solution for FOC!

Avatar

Level 10

gummadala wrote...

Hi,

CDNs are used for caching. You need to follow a particular convention

& process to achieve this after agreeing with your CDN provider. It is immaterial

if CDNs store in binary format or not. On a global scale you need to determine

from which geographic location your (browser) request is coming from.With more than

one CDN, fixing a url is probably not a good idea. If your CDN is finalized, I'd recommend

running through their manuals.

- Venu Gummadala

 

 

Hello Venu,

I am looking for an advice for referencing asset's binary data stored outside AEM, irrespective of the location it is stored.

Since i want to knock off the asset's binary data from AEM and have a reference to the file stored in AEM, with the asset itself residing outside AEM.

Is this possible?

Regards,

NZ

Avatar

Level 1

binary data format is a low level thing usually taken care by the product & I think you should not be worried about it ..

from your second posting I understand you have a legacy CMS/DBMS with huge files in it .. and you want to leverage

CQ as a front end .. yes it is possible .. be with CDN or legacy systems ...

 

Venu Gummadala

Avatar

Level 10

gummadala wrote...

binary data format is a low level thing usually taken care by the product & I think you should not be worried about it ..

from your second posting I understand you have a legacy CMS/DBMS with huge files in it .. and you want to leverage

CQ as a front end .. yes it is possible .. be with CDN or legacy systems ...

 

Venu Gummadala

 

Sorry Venu, I don't think i have made myself clear here. I want an approach to NOT have asset's binary data in AEM but elsewhere, and the reference in AEM, a pure architectural level discussion

Avatar

Level 8

There are couple of things that you would need to do to support this:

  1. The first thing you need to consider is how you want authors to select/enter the image to be referenced. Do you want to assume that authors know the full URL or do you want to build a author experience where they can search for or browse the external images. 
  2. Let's start with the simple version where the author has to know the URL of the image. Is this case for any component where you want to display one of these external images you would either replace the smart widget with a text field that the author would enter the URL. Or if you wanted to support both internal and external then you would add the text field instead of replacing. 
  3. Then you would change the JSPs of any of those components to print out that full URL with the external host name.
  4. In the more complex version you would either have to create an additional custom tab in the content finder that would display/search the external image store, or create a custom ExtJS widget that would allow the search/browse. If you implement the custom content finder then you would be able to use the smart image widget in your dialogs and you would just need to adjust your JSPs to account for how to handle the external URLs that would be stored in the file reference (since you wouldn't want to feed an external URL into the Image bean). 
  5. You'd need to worry about how you would handle HTTPS pages since your media would be on a separate host name. You'd need to consider some sort of approach  to ensure that your external references got converted to HTTPS references. 

Avatar

Level 10

orotas wrote...

There are couple of things that you would need to do to support this:

  1. The first thing you need to consider is how you want authors to select/enter the image to be referenced. Do you want to assume that authors know the full URL or do you want to build a author experience where they can search for or browse the external images. 
  2. Let's start with the simple version where the author has to know the URL of the image. Is this case for any component where you want to display one of these external images you would either replace the smart widget with a text field that the author would enter the URL. Or if you wanted to support both internal and external then you would add the text field instead of replacing. 
  3. Then you would change the JSPs of any of those components to print out that full URL with the external host name.
  4. In the more complex version you would either have to create an additional custom tab in the content finder that would display/search the external image store, or create a custom ExtJS widget that would allow the search/browse. If you implement the custom content finder then you would be able to use the smart image widget in your dialogs and you would just need to adjust your JSPs to account for how to handle the external URLs that would be stored in the file reference (since you wouldn't want to feed an external URL into the Image bean). 
  5. You'd need to worry about how you would handle HTTPS pages since your media would be on a separate host name. You'd need to consider some sort of approach  to ensure that your external references got converted to HTTPS references. 

 

Hello,

So according to the use case.

1. The image is uploaded to DAM with a smart URL, and a property A

2. In DAM Update Asset, i look for the property A and finding it present in the metadata property,  i tried to delete the binary data stored in the jcr:data property under the path /content/dam/test/asset.pdf/jcr:content/renditions/original/jcr:content but i could not since it is a mandatory field.Neither could i set it to null.

3. I know OOTB Image components look for the binary data of the original file while rendering, hence my other approach of deleting the original file in itself was not all that good approach.

4. Now i read in AEM, ", if you store a 300KB JPG image in your repository somewhere, the JPG contents, being above the threshold size (4096 bytes, by default), will be stored in the datastore, and it will be placed into file with just the contents of that one JPG image, with no encoding or obfuscation. If you were to find the individual file, it will be the JPG image."

I would like to know if i could try to mock this approach, since although the file content is stored in the data store the image gets successfully rendered in the image component. I am wondering how exactly has adobe handled such situation where the contents of the file are stored elsewhere in the datastore, yet the image component could reference them and obtain the stream/binary data.

 

Regards,

Avatar

Correct answer by
Level 8

Ah I misunderstood your use case. There is no way use the DAM and store the binary somewhere else. Realistically you have 3 options in my opinion:

  1. Follow AEM standard and store and serve the binary from AEM. 
  2. Store the binary somewhere else and in the image components that render image on pages you store a reference to the binary in that other system and your image components point to that URL at run time. 
  3. Store the binary in AEM DAM and in the other system. One of the pieces of meta-data you store in AEM is a pointer to the binary in the other system. Then at runtime your image components use that point rather than the AEM URL. Depending on your process for creating these images you create a custom workflow that would publish and image to the other system. This is similar to how the Scene 7 integration works - http://dev.day.com/docs/en/cq/current/administering/integrating_with_adobe_marketing_cloud/scene7.ht...

Avatar

Level 10

orotas wrote...

Ah I misunderstood your use case. There is no way use the DAM and store the binary somewhere else. Realistically you have 3 options in my opinion:

  1. Follow AEM standard and store and serve the binary from AEM. 
  2. Store the binary somewhere else and in the image components that render image on pages you store a reference to the binary in that other system and your image components point to that URL at run time. 
  3. Store the binary in AEM DAM and in the other system. One of the pieces of meta-data you store in AEM is a pointer to the binary in the other system. Then at runtime your image components use that point rather than the AEM URL. Depending on your process for creating these images you create a custom workflow that would publish and image to the other system. This is similar to how the Scene 7 integration works - http://dev.day.com/docs/en/cq/current/administering/integrating_with_adobe_marketing_cloud/scene7.ht...

 

So do you think there is a way to use the Data Store approach here? Storing the binary data in the data store and referencing here? But the real question would be how does aem reference to the binary data from the data store

Avatar

Level 8

AEM stores binaries in the data store using an MD5 hash of the file as the file name - the directory structure is not predictable however. The path to the item in the data store is not exposed outside of the persistence manager so there is no realistic way to leverage the data store. 

What exactly are you trying to achieve - is this an existing asset store you are attempting to leverage, or are you concerned about publishing/performance? 

Avatar

Level 10

orotas wrote...

AEM stores binaries in the data store using an MD5 hash of the file as the file name - the directory structure is not predictable however. The path to the item in the data store is not exposed outside of the persistence manager so there is no realistic way to leverage the data store. 

What exactly are you trying to achieve - is this an existing asset store you are attempting to leverage, or are you concerned about publishing/performance? 

 

yes, I am concerned about performance, i would have assets stored at some location in another environment, I would get it into AEM(by uploading), generate renditions, metadata and then delete the binary data , and have it referenced to an external url where the binary data is stored.

I came to a point where i could upload the asset and generate metadata and renditions along with setting a url property to reference the asset from a remote location, but when i wanted to delete the jcr:data, it threw an error that was a mandatory property and cannot be null, so i was wondering if i could get an approach just the way aem stores binary data elsewhere but references in AEM.