Url Shortning
Hello All,
I am working on a project that has multiple websites(AEM Cloud). I am implementing URL shortening and have created a LinkTransformImpl file for this purpose.
In my implementation, I am iterating over the attributes of an href tag and checking for the presence of a linkTransform attribute. For one of the websites in my project (industrial-transformation), when I print the value of attributes.getValue(i) on our dev server, it prints /language-masters/en/home.html, but on my local environment, it prints the correct path starting from /content/industrial-transformation/language-master/. For other websites in the project, it prints the correct path on both the dev server and local environment.
Can anyone suggest a solution to this problem?
if (linkTransform && Optional.ofNullable(hrefTag).isPresent()) {
for (int i = 0; i < attributes.getLength(); i++) {
log.info("lavishtesting "+attributes.getValue(i)+ " testinglavish");
if (HREF.equalsIgnoreCase(attributes.getQName(i))) {
String value = "";
if (attributes.getValue(i).contains(CONTENT) && attributes.getValue(i).contains(CONTENT_HTML)) {
value = attributes.getValue(i).replaceAll(CONTENT_HTML, "");
value = value.replace(CONTENT, "");