Expand my Community achievements bar.

SOLVED

Dynamic media integration via Java USE API or Sling model (JS USE API is deprecated)

Avatar

Level 1

Hello all,

 

Starting form AEMaaCS 2024.8 version maintenance update the use of JS USE API is deprecated, and per Adobe's advice there is need to use Java USE API or Sling models.

Deprecated features can be found follwoing by link - https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/release-notes/de...

Currently we are using Dynamic Media functionality integarted in custom video component, via JS use API (please see snippet below)

<div data-sly-use.dmInfo="dynamicmedia_sly.js"
data-sly-use.clientLib="${'/libs/granite/sightly/templates/clientlib.html'}"
data-sly-test="${dmInfo.isDMEnabled || dmInfo.isS7Enabled || dmInfo.isWCMDisabled}"
data-sly-unwrap>
<sly data-sly-call="${clientLib.all @ categories='cq.dam.components.scene7.dynamicmedia,cq.dam.components.scene7.common.i18n'}" />

Dynamic media script is located under "/libs/dam/components/scene7/dynamicmedia/dynamicmedia_sly.js" directory. Also, in the error logs of enviromnet we noticed following warning message about the deprecation

 

*WARN* 

 org.apache.sling.scripting.sightly.js.impl.use.DependencyResolver Script 

/apps/org/components/org/video/video.html loaded script /libs/dam/components/scene7/dynamicmedia/dynamicmedia_sly.js which relies on the Apache Sling Scripting HTL JS Use Provider that got deprecated in AEMaaCS 2024.8. 

Please update your Use script to a different flavour of the Use API (e.g. Sling Models or the Java Use API).

 

So the question is how can be existing DM functionality, provided via JS, changed into Java USE API or Sling model, is there any Adobe provided solutions, or is there Adobe's core video component which can have integrated DM fuctionality, which is working without JS USE API

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi,

 

for ootb-provided JS-based Sling models it's of course not possible to enforce it; but thanks for the report, I will see that this one is replaced by a proper Java-based Sling Model.

 

View solution in original post

2 Replies

Avatar

Correct answer by
Employee Advisor

Hi,

 

for ootb-provided JS-based Sling models it's of course not possible to enforce it; but thanks for the report, I will see that this one is replaced by a proper Java-based Sling Model.

 

Avatar

Community Advisor

Starting from AEMaaCS 2024.8, the JS USE API is deprecated, and Adobe recommends using Java USE API or Sling Models instead. The current dynamic media functionality in your custom video component, implemented using JS USE API, needs to be updated.

To replace the JS USE API:

  1. Java USE API: You can rewrite the logic in a Java-based Use API. Create a Java class that interacts with Dynamic Media and provides the necessary data to the component.

  2. Sling Models: Alternatively, you can create a Sling Model to encapsulate the Dynamic Media logic and inject the model into your component.

Adobe doesn't provide a direct replacement for the JS-based Dynamic Media functionality, so you'd need to refactor the component using either the Java USE API or Sling Models.

To avoid JS, you could explore Adobe's core video component, but it may require customization to integrate Dynamic Media functionality.