Custom Link Transformer for non prod environments | Community
Skip to main content
November 15, 2023
Solved

Custom Link Transformer for non prod environments

  • November 15, 2023
  • 2 replies
  • 692 views

Hi All - I have run into an issue where i have implemented a custom link transformer which needs to be run on non prod environment ( qa, stage, local). I tried adding rewrite config under /apps/<project>/config.<runmode> but my LinkTransformer is not getting called. My linktransformer works fine when added under apps/<project>/config. I need suggesstion on how can i achieve this requirement of running link transformer only on specific environment.

 

Thanks in advance.

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 arunpatidar

Hi @praja1987 

 

Unfortunately the rewriter definition does not support runmodes. So you need to have your rewriter configured in all environments; and then add some runmode based logic in java implementation, which disables the actual rewriting process on prod.

 

https://sling.apache.org/documentation/bundles/output-rewriting-pipelines-org-apache-sling-rewriter.html#configuring-a-processor-1 

 

2 replies

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
November 15, 2023

Hi @praja1987 

 

Unfortunately the rewriter definition does not support runmodes. So you need to have your rewriter configured in all environments; and then add some runmode based logic in java implementation, which disables the actual rewriting process on prod.

 

https://sling.apache.org/documentation/bundles/output-rewriting-pipelines-org-apache-sling-rewriter.html#configuring-a-processor-1 

 

Arun Patidar
kautuk_sahni
Community Manager
Community Manager
November 15, 2023

@praja1987 Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Kautuk Sahni