Clientlibs versioning without using ACS Commons Versioned ClientLibs | Community
Skip to main content
July 20, 2020
Solved

Clientlibs versioning without using ACS Commons Versioned ClientLibs

  • July 20, 2020
  • 1 reply
  • 907 views

Hello All - We want to add version details to the clientlibs like the e.g.: E.g.: /etc/designs/testa/testb/testclientlibs.min.version2.1.0.0.js (appending version details at the suffix).

 

Currently we are adding the version details and generate the clientlibs based on project release details. We use our existing framework to generate the build details. To achieve this, we had to add the version details in the JSP using custom taglibs. I know that we cannot use the taglibs in the HTL. Is there any way to handle this in HTL without making major changes. We don't want to go with ACS commons versioned clientlibs route. Can someone please help on this?

 

@arunpatidar  @smacdonald2008 @arpitvarshney @ratna_kumar 

 
 
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Nupur_Jain

Hi @v1101 

 

In order to add build information to the clientlibs, you can create sling output pipeline that is implementing a transformer facyory. In your transformar factory, you can tranform links in script/style tags. This solution will be independent of JSP/HTL.

 

In order to read more about transformers, Read:
1. Sling oficial documentation: https://sling.apache.org/documentation/bundles/output-rewriting-pipelines-org-apache-sling-rewriter.html#:~:text=The%20Apache%20Sling%20Rewriter%20is,the%20base%20for%20further%20transformation.

2. Example blog: https://www.cognifide.com/our-blogs/zen-garden/aem-transformers

3. Git code example: https://github.com/PerficientDigital/Sling-Rewriting-Pipeline-Demo/blob/master/core/src/main/java/com/perficient/adobe/rewriter/LinkTypeTransformerFactory.java

 

If you do not want many changes to be done, why don't you keep jsp logic as it is and include jsp file using data-sly-include in HTL.

 

<section data-sly-include="path/to/template.jsp"></section>
 

 

Hope it helps!

Thanks!

Nupur

1 reply

Nupur_Jain
Adobe Employee
Nupur_JainAdobe EmployeeAccepted solution
Adobe Employee
July 29, 2020

Hi @v1101 

 

In order to add build information to the clientlibs, you can create sling output pipeline that is implementing a transformer facyory. In your transformar factory, you can tranform links in script/style tags. This solution will be independent of JSP/HTL.

 

In order to read more about transformers, Read:
1. Sling oficial documentation: https://sling.apache.org/documentation/bundles/output-rewriting-pipelines-org-apache-sling-rewriter.html#:~:text=The%20Apache%20Sling%20Rewriter%20is,the%20base%20for%20further%20transformation.

2. Example blog: https://www.cognifide.com/our-blogs/zen-garden/aem-transformers

3. Git code example: https://github.com/PerficientDigital/Sling-Rewriting-Pipeline-Demo/blob/master/core/src/main/java/com/perficient/adobe/rewriter/LinkTypeTransformerFactory.java

 

If you do not want many changes to be done, why don't you keep jsp logic as it is and include jsp file using data-sly-include in HTL.

 

<section data-sly-include="path/to/template.jsp"></section>
 

 

Hope it helps!

Thanks!

Nupur