Expand my Community achievements bar.

SOLVED

Overlay Concern

Avatar

Level 2

Hi All,

We were customizing certain scripts for the DAM console through an overlay. However, we found that this resulted in folder duplication while creating folders and multiple downloads for a single asset. We deleted certain folders which removed our concern altogether. These folders or the scripts in them were not customized .

The concern would be

A)The correct procedure to perform an overlay including the do's and dont's.

B) Our procedure of overlay was to replicate the folders under "libs" to "apps". If this is correct, the duplication of folders/multiple downloads of assets is of concern.

C) Is there a difference in the way we do overlay across AEM releases?

Thank you in advance.

 

Regards,

Sagar

1 Accepted Solution

Avatar

Correct answer by
Level 9

Use of the Overlay component is , when you want to use the out-of-box component and you want to add some extra feature in it , so instead of changing the code from “/libs/foundation/components/component-name.jsp” just follow the below process and use it. By using this we can use the out-of-box feature with our extra feature without changing behaviur of out-of-box component . So that other projects which are using it can't be affected.

CQ5 overlay leverages sling rules for resource resolving. if /libs/foundation/components/text needs an overlay, you overlay the corresponding file at location /apps/foundation/components/text/filename This will change how the foundation component behaves in all instances. And the existing sidekick component remains, but behaves differently.

If you have a new  component at /apps/myproject/components/text, it can inherit from the foundation component via sling:resourceSuperType on the new component. In that case, you have a new component in the sidekick. In your new component, you could use the same values for jcr:title, componentGroup, or you could change them to distinguish your component in the sidekick. If the title, componentGroups are the same, the sidekick can distinguish them with parenthesis around the webapp (foundation) vs (myproject).

View solution in original post

2 Replies

Avatar

Correct answer by
Level 9

Use of the Overlay component is , when you want to use the out-of-box component and you want to add some extra feature in it , so instead of changing the code from “/libs/foundation/components/component-name.jsp” just follow the below process and use it. By using this we can use the out-of-box feature with our extra feature without changing behaviur of out-of-box component . So that other projects which are using it can't be affected.

CQ5 overlay leverages sling rules for resource resolving. if /libs/foundation/components/text needs an overlay, you overlay the corresponding file at location /apps/foundation/components/text/filename This will change how the foundation component behaves in all instances. And the existing sidekick component remains, but behaves differently.

If you have a new  component at /apps/myproject/components/text, it can inherit from the foundation component via sling:resourceSuperType on the new component. In that case, you have a new component in the sidekick. In your new component, you could use the same values for jcr:title, componentGroup, or you could change them to distinguish your component in the sidekick. If the title, componentGroups are the same, the sidekick can distinguish them with parenthesis around the webapp (foundation) vs (myproject).

Avatar

Level 2

Thank you Mshajiahmed.

We are just trying to customize Metadata for Dam Assets. It required modification of a certain amount of JS in the overlay. However, the duplication

was due to presence of JS which were not modified. The JS being simply present caused the duplication/multiple downloads. Understandable that you need to overlay JS which need to be customized, my second question was in the line that how could mere presence of the same script(with could cause folder duplication/multiple downloads) . Trying to understand that.

 

Regards,

Sagar