Search code examples
aemslingsling-models

Parameter to disable Sling filter in AEM


I have created a sling filter. Below is a snippet -

@SlingFilter(label = "My filter", description = "Myfilter", metatype = true, generateComponent = true, generateService = true, order = 0, scope = SlingFilterScope.INCLUDE)

public class SlingInoFilter implements Filter { 
}

When I deploy my code, I want this filter to be deployed but in a disabled state. Is this achievable?


Solution

  • You can disable it by using ACS commons component disabler: https://adobe-consulting-services.github.io/acs-aem-commons/features/osgi-disablers/component-disabler/index.html